使用cnn做手写数字识别_使用CNN分类的手写数字识别(过程说明)

使用cnn做手写数字识别

“Artificial Intelligence is a branch of science which offers with helping machines discover solutions to complex problems in a greater human-like-fashion” (Sridhar, 2020). In different words, Minsky defines AI as “the science of making machines do things that would require Genius if finished by using men”.AI is a concerted effort to apprehend the complexity of human ride in the procedure of information. This addresses now not only how to scientifically represent and use complex and incomplete data however additionally how to see (Vision), pass (robotics), conversation (natural language, speech) and apprehend (memory, thought, classification).

“人工智能是科学的一个分支,它可以帮助机器以类似人类的方式发现复杂问题的解决方案”(Sridhar,2020年)。 用不同的话来说,明斯基将人工智能定义为“使机器完成人类需要完成才能完成的事情的科学”。人工智能是共同努力,以了解人类在信息处理过程中的复杂性。 现在,这不仅解决了如何科学地表示和使用复杂且不完整的数据,而且还解决了如何查看(视觉),通过(机器人),对话(自然语言,语音)和理解(记忆,思想,分类)。

问题域 (Problem Domain)

Hand-written digit cognizance is the capacity of a PC system to apprehend hand-written inputs such as digits, characters, etc. from a extensive variety of sources such as emails, documents, images, letters, etc. This has been a problem of lookup for decades. Some areas of lookup consist of verification of signatures, processing of bank checks, interpretation of postal addresses from envelopes and many extra are turn out to be less difficult and extra handy through digit recognition methods. Several classification methods using Machine Learning have been developed and used for this purpose, such as K-Nearest Neighbors, SVM Classifier, Random Forest Classifier, etc., but these methods, whilst having the accuracy of 97%, are not adequate for real-world purposes.In current years, the research community has been gaining significant interest in deep learning-based strategies to remedy a range of supervised, unsupervised and reinforced getting to know problems. One of the most regularly occurring and broadly used strategies is Convolution neural networks (CNN's), a kind of neural networks which can extract relevant features robotic-ally from enter information. Here, we will learn about the implementation of well-known MNIST facts set to predict and recognize handwritten digits the use of deep gaining knowledge of techniques and Machine Learning algorithms. This is not a new topic and the MNIST information set is nonetheless very common and essential to take a look at and affirm new algorithms after quite a few decades. The project requires a lot of libraries such as primary ML libraries, deep mastering libraries, EDA (Exploratory Data Analysis) and tensor-flow the place tensor-flow is used as back-end with keras at some stage in the development process.

H和手写数字识别功能是PC系统从大量来源(例如电子邮件,文档,图像,字母等)中识别手写输入(例如数字,字符等)的能力。这是一个问题查找数十年。 查找的某些区域包括签名验证,银行支票处理,信封中的邮政地址解释等,通过数字识别方法,发现许多其他方面的难度较小,并且非常方便。 已经开发了几种使用机器学习的分类方法并将其用于此目的,例如K最近邻,SVM分类器,随机森林分类器等,但是这些方法尽管具有97%的准确度,但不足以用于实际近年来,研究界对基于深度学习的策略以解决一系列有监督,无监督和强化的了解问题的方法越来越感兴趣。 卷积神经网络(CNN's)是最经常出现且使用最广泛的策略之一,它是一种可以从输入的信息中自动提取相关特征的神经网络。 在这里,我们将学习众所周知的MNIST事实的实现方法,这些事实集是通过使用深厚的技术知识和机器学习算法来预测和识别手写数字的。 这不是一个新话题,并且在几十年后,MNIST信息集对于查看和确认新算法非常普遍且必不可少。 该项目需要很多库,例如主要ML库,深度母版库,EDA(探索性数据分析)和张量流,在开发过程的某个阶段,将张量流用作keras的后端。

背景 (Background)

Generally Handwriting Character Recognition (HCR) is categorized into six phases which are acquisition of image, pre-processing of enter image, segmentation, feature extraction, classification and put up processing .

通常,手写字符识别(HCR)分为六个阶段,即图像获取,输入图像的预处理,分割,特征提取,分类和组装处理。

Block Diagram of Handwriting Character Recognition 手写字符识别框图

A. Image AcquisitionThe input photo is supplied to the consciousness gadget at the Image Acquisition stage. The input can be either in an photograph layout such as JPEG, BMT, etc., or a scanned image, digital camera, or any other gorgeous digital input machine or can be taken from the canvas on the person interface.

A.图像采集在图像采集阶段,将输入的照片提供给意识小工具。 输入可以是诸如JPEG,BMT等的照片布局,也可以是扫描图像,数码相机或任何其他华丽的数字输入机,或者可以从人机界面上的画布上获取。

B. Pre-ProcessingThe 2nd method, known as pre-processing, is the entry approach for personality cognizance and is very essential in finding out the focus quality. Preprocessing operates to normalize strokes and also to take away deviations that can minimize the accuracy rate. Preprocessing works usually on distinctive distortions such as irregular textual content size, missing points at some point of pen movement, jitters, left — proper bend and uneven spaces.

B.预处理第二种方法,称为预处理,是个性识别的入门方法,对于找出焦点质量非常重要。 预处理的作用是使笔划归一化,并消除可能使准确率降到最低的偏差。 预处理通常针​​对明显的失真进行处理,例如不规则的文本内容大小,笔移动的某个点上的缺失点,抖动,向左弯曲(适当的弯曲)和不均匀的空间。

C. SegmentationSegmentation is used to transform the enter representation of many characters to the individual characters. The methods used are the segmentation of words, strains and characters. Typically, it is carried out by way of isolating a single persona from a word picture. In addition, the contents are processed in a way that is like a tree. In the initial scenario, the line histogram is used to phase the lines. After that, each level, the characters are retrieved by a approach known as histogram, and subsequently they are retrieved.

C. SegmentationSegmentation用于将许多字符的输入表示形式转换为单个字符。 所使用的方法是单词,单词和字符的分割。 通常,它是通过从单词图片中分离单个角色来实现的。 另外,以类似于树的方式处理内容。 在初始方案中,线直方图用于对线进行定相。 然后,在每个级别上,通过称为直方图的方法来检索字符,然后对其进行检索。

D. Feature ExtractionThe aim of the extraction characteristic is to permit the extraction of the sample that is most important for classification. Some of the Extraction Function techniques such as Principle Component Analysis (PCA), Scale Invariant Feature Extraction (SIFT), Linear Discriminant Analysis (LDA), Histogram, Chain Code (CC), Zoning and Gradient-based applied sciences can also be used to get rid of the traits of character characters. All of these functions are used to educate the system. Each of the segmented pictures is taken with a pixel of dimension 28* 28 .By flattening the array into a vector of 28 * 28 = 784 numbers, the photograph now converges to a minimal bunch of arrays in a quite high-quality structure 784-cell dimension. The photograph now turns into a n dimensional array tensor.

D.特征提取提取特征的目的是允许提取对于分类最重要的样品。 某些提取函数技术(例如主成分分析(PCA),尺度不变特征提取(SIFT),线性判别分析(LDA),直方图,链码(CC),基于分区和渐变的应用科学)也可以用于摆脱人物角色的特征。 所有这些功能都用于教育系统。 每张分割后的图片都是使用尺寸为28 * 28的像素拍摄的。通过将阵列展平为28 * 28 = 784个数字的矢量,该照片现在会聚为具有相当高质量结构的最小阵列阵列784-单元尺寸。 现在,照片变成了维数张量。

E. ClassificationDecision-making takes vicinity at some point of the classification process. The extracted attributes are used to become aware of the characters. Different classifiers algorithms are used, such as SVM and Neural Networks. The classifiers sort the precise input function with reserved sample and find the best matching input classification for which Soft Max Regression is being used. Soft Max regression assigns each result with the probability so classification will become easy. This essentially incorporates all the proof this obtains through using components and then transforms it into the conceivable chances .

E.分类决策在分类过程中的某个时刻临近。 提取的属性用于识别字符。 使用了不同的分类器算法,例如SVM和神经网络。 分类器使用保留的样本对精确的输入函数进行排序,并找到使用Soft Max回归的最佳匹配输入分类。 Soft Max回归通过概率分配每个结果,因此分类变得容易。 这本质上包含了通过使用组件获得的所有证据,然后将其转化为可以想到的机会。

F. Post-ProcessingThe Post-processing is the last and ultimate phase of persona recognition. It is the procedure whereby herbal language is used to right the misclassified output. It procedures output by means of getting it after a recognition of the shape. If the shape is diagnosed basically then the accuracy can be increased in accordance to language knowledge. For exclusive handwriting inputs, shape recognizers behave differently.Since 1998, researchers have been learning the hassle of handwritten digit focus with almost all the algorithms developed with the aid of then and even up till now. The rate of test blunders reduced from 12% in 1988 per linear classifier to 0.23% in 2012 through Convolutionary networks, and extra and extra facts scientists and computer studying experts are attempting to increase and validate unsupervised getting to know methods such as auto encoders and deep getting to know models.The MNIST database consists of 70000 handwritten digitized numerals dispensed in ten different classes. For training purposes, the entire dataset is divided into 60,000 images, and the ultimate ten thousand is reserved for the check collection. In this work in the interval[0,1], the gray level values of every pixel are coded the use of a price of 0 for white pixels and 1 for black pixel.In the MNIST dataset, the records is already properly prepared: the pics have been founded in a 28x28 picture by computing the core of the pixel mass and translating the picture to role this point at the core of the 28x28 field. The coaching set consists of 30,000 patterns from SD-3 and 30,000 patterns from SD-1 and the take a look at set consisted of 5,000 SD-3 patterns, and 5,000 SD-1 patterns

F.后处理后处理是角色识别的最后也是最终阶段。 这是使用草药语言纠正错误分类的输出的过程。 它通过在识别形状后获取输出来对输出进行处理。 如果基本上诊断出形状,则可以根据语言知识来提高精度。 自1998年以来,研究人员一直在学习手写数字聚焦的麻烦,几乎所有的算法都是借助当时甚至直到现在才开发出来的。 通过卷积网络,测试失误的比率从1988年的每个线性分类器的12%降低到2012年的0.23%,科学家和计算机研究专家的越来越多的事实正试图增加和验证无监督的自动编码器和深度编码器等方法。 MNIST数据库由70000个手写数字化数字组成,分为十个不同类别。 为了进行培训,将整个数据集划分为60,000张图像,最后一万张保留用于支票收集。 在区间[0,1]中的工作中,每个像素的灰度值使用白色像素的价格0和黑色像素的价格1进行编码。在MNIST数据集中,记录已正确准备:通过计算像素质量的核心并将图片转换为28x28场核心的这一点,可以在28x28图片中创建图片。 教练组由SD-3的30,000个模式和SD-1的30,000个模式组成,看一下由5,000个SD-3的模式和5,000个SD-1的模式组成的集合

Sample Dataset 样本数据集

方法论(使用CNN分类器) (Methodology(Using CNN Classifier))

Handwritten digit identification has come to be a subject of hobby among researchers. A giant variety of papers and articles about this situation are being posted in these days. It is proven in lookup that Deep Learning algorithms such as multilayer CNN the use of Keras with Tensorflow grant the absolute best accuracy compared to the most normally used machine getting to know algorithms such as SVM, KNN & RFC (Siddique et al., 2019). Because of its very best accuracy, Convolutional Neural Network (CNN) is being used for this project.One of the earliest rankings was posted with the aid of (Lecun et al., 1998) themselves, which includes references up to 2012 (Baldominos et al., 2019). “It can be effortlessly validated that the early computer getting to know techniques used by way of (Lecun et al., 1998) protected linear classifiers (whose error rate stages from 7.6 to 12%), K-nearest neighbors procedures (K-NN, ranging from 1.1 to 5%), non-linear classifiers (about 3.5%), help vector machines (SVM, from 0.8 to 1.4%), neural networks (NN, from 1.6 to 4.7%) and convolutional neural networks (CNN, from 0.7 to 1.7%)”. It is notable that the additional facts results, are higher carried out through a Convolutionary neural network besides distortion or preprocessing in (Lecun et al., 1998) used to be 0.95% (Baldominos et al., 2019).CNNs are beneficial mannequin category for both supervised and unsupervised gaining knowledge of paradigms, the place K-NN is used for unsupervised learning, and SVM is used for supervised learning. The supervised getting to know mechanism is the one the place the system enter and outputs (true labels) are identified and a mapping between the two is discovered. In the unsupervised gaining knowledge of mechanism, the proper labels for a given set of inputs are no longer known, and the mannequin ambitions to estimate the underlying distribution of data sample inputs (Khan et al., 2018).The points of Convolutionary neural networks, together with the capability to extract information from multidimensional sources, provide them with a very useful option for solving laptop vision problems. Since the assignment is about extracting the elements from an photo and is associated to computer imaginative and prescient problems; hence, convolutional neural community is used (Baldominos et al., 2019)To recognize the handwritten digits, a seven-layered convolutional neural community with one input layer accompanied by hidden layers and two output layer is designed and illustrated below.

手写数字识别已成为研究人员的爱好之一。 如今,有关此情况的大量论文和文章都在发布。 在查找中证明,与最常使用的机器了解诸如SVM,KNN和RFC之类的算法相比,诸如多层CNN之类的深度学习算法与Tensorflow一起使用Keras可以提供绝对最佳的准确性(Siddique等人,2019) 。 由于卷积神经网络(CNN)的准确性最高,因此被用于该项目。(Lecun等人,1998)自己发布了最早的排名之一,其中包括直到2012年的参考文献(Baldominos等)等(2019)。 “可以毫不费力地验证,早期计算机了解(Lecun等人,1998)使用的技术保护了线性分类器(错误率从7.6%降至12%),K近邻法(K-NN)。 ,范围从1.1到5%),非线性分类器(约3.5%),帮助向量机(SVM,从0.8到1.4%),神经网络(NN,从1.6到4.7%)和卷积神经网络(CNN,从0.7到1.7%)”。 值得注意的是,除了(Lecun等人,1998)中的失真或预处理(0.9%)(Baldominos等人,2019)之外,通过卷积神经网络进行的其他事实结果要更高(CalNNs是有益的人体模型)。对于有监督和无监督的范例知识获取,将K-NN用于无监督学习,将SVM用于有监督学习。 有监督的了解机制是一种识别系统输入和输出(真实标签)并在两者之间建立映射的地方。 在无监督的机制知识中,对于给定输入集的合适标签不再是已知的,并且人体模型雄心勃勃地估计数据样本输入的基础分布(Khan等人,2018)。以及从多维来源提取信息的功能,为他们提供了解决笔记本电脑视觉问题的非常有用的选项。 由于作业是从照片中提取元素,并且与计算机的想象力和先验问题相关联; 因此,使用卷积神经社区(Baldominos等人,2019)来识别手写数字,下面设计并说明了一个七层的卷积神经社区,其中一个输入层伴有隐藏层,两个输出层。

CNN Architecture CNN架构

算法 (Algorithm)

CNN object classification mannequin takes, analyzed and classifies an enter photo which in our case is digits under a positive category. Deep learning allows CNN fashions to be skilled and tested. photograph is transmitted via a collection of filters (kernels), pooling and Fully connected convolution layers and makes use of Softmax to classify an object with probabilistic values between zero and 1.

CNN对象分类模型对输入的照片进行拍摄,分析和分类,在我们的示例中,该照片是正数类别下的数字。 深度学习可让CNN时尚技术得到测试。 照片通过过滤器(内核),池和全连接卷积层的集合进行传输,并利用Softmax对概率值为0到1的对象进行分类。

A CNN consists of a lot of layers. These layers when used repeatedly, lead to a formation of a Deep Neural Network. The fundamental types of layers used to build a CNN are:1. InputThis layer holds the uncooked pixel values of photograph and convert it to grayscale pics using 28x28 matrix of pixels.2. Convolutional LayerThis layer gets the effects of the neuron layer that is linked to the enter regions. The wide variety of filters to be used in this layer is described here. Each filter may additionally be a 5x5 window that slider over the input records and receives the pixel with the most intensity as the output.3. Rectified Linear Unit (ReLU) LayerThis layer applies an thing smart activation function on the picture records and makes use of again propagation techniques. ReLU function is utilized in order to preserve the equal values of the pixels and not being changed by means of the returned propagation.4. Pooling LayerDown-sampling operation along the spatial dimensions (width, height), resulting in volume is utilized in this layer.5. Fully Connected LayerThis layer is used to compute the score instructions that potential which class has the maximum score corresponding to the enter digits. The category label with the largest likelihood is chosen as the ultimate classification from the network and proven in the output.

CNN 的由很多层的。 重复使用这些层会导致形成深度神经网络。 用于构建CNN的基本层类型为:1。 输入该层保存未煮过的照片像素值,并使用28x28像素矩阵将其转换为灰度图片2。 卷积层该层获得链接到输入区域的神经元层的效果。 此处介绍了此层要使用的各种过滤器。 每个滤镜还可以是一个5x5的窗口,它可以在输入记录上滑动并接收强度最高的像素作为输出。3。 整流线性单元(ReLU)层该层在图片记录上应用了智能智能激活功能,并再次使用了传播技术。 利用ReLU函数来保留像素的相等值,并且不通过返回的传播对其进行更改。4。 沿空间维度(宽度,高度)合并LayerDown采样操作,从而在该层中利用体积5。 完全连接层该层用于计算得分指令,以指示哪个类别具有与输入数字相对应的最大得分。 从网络中选择可能性最大的类别标签作为最终分类,并在输出中进行验证。

实作 (Implementation)

A. TensorflowTensorflow is used as backend in the application of this project. TensorFlow is an brilliant records circulation in the Machine Learning Library made by means of the Google Brain Team and made open supply in 2015. It is designed to ease the use and greatly relevant to each numeric and neural gadget troubles simply like different spaces. TensorFlow is essentially a low-level math-entangled tool that pursuits experts who apprehend what they’re doing to construct exploratory studying structures, play around with them, and turn them into running programs. For the most part, it can be considered as a programming context in which equations can be entitled as graphs. Math things to do are spoken by using nodes in the graph, and the edges include the multidimensional facts clusters (tensors) linked to them.

答:TensorflowTensorflow在此项目的应用程序中用作后端。 TensorFlow是由Google Brain团队在机器学习库中进行的出色记录发行,并于2015年公开供应。它的设计易于使用,并且与每个数字和神经小工具问题(如不同的空间)都非常相关。 TensorFlow本质上是一个低级的,纠缠于数学的工具,它吸引着那些了解他们在做什么的专家,这些专家正在构造探索性的学习结构,对其进行处理,然后将它们变成正在运行的程序。 在大多数情况下,可以将其视为等式可以称为图形的编程环境。 通过使用图中的节点可以说出要进行的数学运算,并且边缘包括与它们链接的多维事实簇(张量)。

B. PythonPython is used for the duration of the implementation of assignment the place several traces of code had been brought in order to accomplish the assignment requirements. Python is typically used globally, and is a high-level programming language. It was once implemented in particular for application dominance, and its language shape allows software program engineers to carry thoughts in fewer traces of code. Python is a programming language which gives the chance to work shortly and more correctly organize frameworks.

B. PythonPython用于执行分配的过程中,为了实现分配要求,已放置了几条代码痕迹。 Python通常在全球范围内使用,是一种高级编程语言。 它曾经是为实现应用程序优势而特别实现的,并且其语言形状使软件程序工程师可以用更少的代码来表达思想。 Python是一种编程语言,它使人们有机会在短期内更正确地组织框架。

C. AnacondaAnaconda is used as IDE all through the implementation of the project. Anaconda is a free and open-source appropriation of the Python and R programming for logical figuring such as statistics science, AI applications, instruction of large-scale information, prescient investigation, etc. Anaconda accompanies over 1,400 programs just like the Conda package and digital surroundings director, Anaconda Navigator, so it takes the want to determine out how each library can be freely added.

C. AnacondaAnaconda在整个项目实施过程中均用作IDE。 Anaconda是Python和R编程的一种免费开放源代码,用于逻辑计算,例如统计科学,AI应用程序,大规模信息的指令,有先见之明等。Anaconda随附1400多个程序,例如Conda软件包和数字环境总监Anaconda Navigator,因此需要确定如何自由添加每个库。

D. KerasKeras is used to build model to arrange the layers in the course of the implementation of this project. Keras is a high-level neural community API written in Python that can run on top of TensorFlow, CNTK, or Theano. It used to be developed with a focal point on allowing for quickly experimentation. The key to doing true lookup is being capable to go from notion to result with the least delay viable.Keras approves for handy and speedy prototyping (through person friendliness, modularity, and extensibility). Similarly, it supports each convolutional networks and recurrent networks, as properly as combinations of the two and runs seamlessly on CPU and GPU.

D. KerasKeras用于构建模型,以在该项目的实施过程中安排各层。 Keras是用Python编写的高级神经社区API,可以在TensorFlow,CNTK或Theano之上运行。 它过去的开发重点是允许快速进行实验。 进行真正查找的关键是能够从概念到结果的延迟最小化。Keras批准了方便快捷的原型制作方法(通过人性化,模块化和可扩展性)。 同样,它支持每个卷积网络和循环网络,以及两者的组合,并且可以在CPU和GPU上无缝运行。

E. NumPyNumPy is used for mathematical calculations to print out the predict records in this project. NumPy is the core bundle with Python for scientific computing. It is a versatile sophisticated (broadcasting) with N-dimensional array object characteristic software program for combining C / C++ and Fortran code, advantageous linear algebra, Fourier transform, and random number capabilities.

E. NumPyNumPy用于数学计算,以打印出该项目中的预测记录。 NumPy是Python用于科学计算的核心软件包。 它是具有N维数组对象特征软件程序的通用复杂(广播)程序,用于组合C / C ++和Fortran代码,有利的线性代数,傅立叶变换和随机数功能。

F. MatplotlibMatplotlib is used to plot model accuracy and loss in a graphical view in this project. Matplotlib is a Python 2D plotting library that produces pleasant figures for the publication throughout platforms in a variety of hardcopy formats and interactive environments. Matplotlib can be used in Python scripts, Python and IPython shells, Jupyter notebook, Web software servers, and four interface toolkits for graphical users.

F. MatplotlibMatplotlib用于在此项目的图形视图中绘制模型的准确性和损失。 Matplotlib是一个Python 2D绘图库,可以在各种硬拷贝格式和交互式环境中为整个平台的发布提供令人愉悦的图形。 Matplotlib可用于Python脚本,Python和IPython Shell,Jupyter笔记本,Web软件服务器以及四个图形用户界面工具包。

取得的成果 (Achieved Results)

At first, required libraries and packages are imported during the implementation of project.

起初 ,所需的库和包工程的实施过程中导入。

Then, object of the MNIST dataset is created and later loaded through the help of Tensorflow backend using Keras. After that, total number of train along with their dimension and test data set is printed out in order to view total number of elements present in the dataset.

然后,创建MNIST数据集的对象,然后使用Keras在Tensorflow后端的帮助下加载该对象。 之后,打印出火车的总数及其尺寸和测试数据集,以查看数据集中存在的元素总数。

After the dataset is loaded, one of the images from the training dataset is loaded and displayed in gray scale format by using matplotlib library.

加载数据集后,将使用matplotlib库加载训练数据集中的图像之一并以灰度格式显示。

Then the training and testing data sets are normalized where image data values are converted in terms of 0 and 1.

然后对训练和测试数据集进行归一化,其中将图像数据值转换为0和1。

After normalizing the data, a CNN model is created using keras library. Then the Flatten layer is added into the model. Then after, input and hidden layer followed by output layers are built using CNN algorithm.

标准化数据后,使用keras库创建CNN模型。 然后,将Flatten图层添加到模型中。 然后,使用CNN算法先构建输入层和隐藏层,再构建输出层。

After building the model successfully, model is compiled using Adam optimization algorithm where this algorithm is used for training Deep Neural Networks (DNN).

成功构建模型后,使用Adam优化算法编译模型,其中该算法用于训练深度神经网络(DNN)。

After compiling the model, model is fit to train data train and training is started using train data set, due to which cross entropy loss and accuracy of the model can be achieved while training the data from dataset.

编译模型后,将模型拟合为训练数据训练,并使用训练数据集开始训练,由于在训练来自数据集的数据时可以实现交叉熵损失和模型的准确性。

After the completion of training of the data set, performance of the model is evaluated using test data set, as well as accuracy and loss of data set is achieved.

在完成数据集的训练之后,使用测试数据集评估模型的性能,并获得数据集的准确性和损失。

After evaluation of model, prediction of the model is made using test data set.

在评估模型之后,使用测试数据集对模型进行预测。

Then, predicted data is printed and displayed using the index of the array.

然后,使用数组的索引打印和显示预测数据。

After the test data of the model is predicted, all available test data set (Image) in the trained model is reshaped to width and height of 28 respectively.

预测模型的测试数据后,将训练后的模型中的所有可用测试数据集(图像)分别调整为28的宽度和高度。

After the image is re shaped, one of the images followed with its label from the test data set is displayed using matplotlib library.

调整图像形状后,将使用matplotlib库显示其中一张图像以及来自测试数据集的标签。

Then, graph is plotted to measure accuracy of the built model using train and test dataset.

然后,绘制图形以使用训练和测试数据集测量构建模型的准确性。

Then, graph is also plotted to measure loss of the built model using train and test dataset.

然后,还绘制图形以使用训练和测试数据集测量构建模型的损失。

After that, image is plotted in gray scale view followed with their predicted label, true label and accuracy. Color is also defined in the class to segregate the expected result outcome.

之后,在灰度视图中绘制图像,并附上其预测标签,真实标签和准确性。 在类中还定义了颜色,以隔离预期结果。

Since, the data set is too huge, it will be difficult to display the whole data set images. So that, number of rows and columns is assigned to display the limited images from the data sets.

由于数据集太大,因此将难以显示整个数据集图像。 因此,分配了行数和列数以显示数据集中的受限图像。

Final Result 最后结果

结论 (Conclusion)

The project of the undertaking is just to create a model which can recognize the digits using MNIST datasets however it can be prolonged to letters and then a person’s handwriting. It can be used by countless organization, schools, banks and even for family activities.Handwritten digit focus will be beneficial for government bodies or any different organization to identify citizenship identification range which helps in automation. Likewise, license card quantity of any individual can be diagnosed thru this system. Similarly, it can be used for academic reason the place student can learn and recognize the real world solution making use of this system. Similarly, postal addresses, bank cheque digit consciousness can be made less complicated thru automation the usage of this system.

这项工作的目的只是创建一个可以使用MNIST数据集识别数字的模型,但是可以将其扩展为字母,然后再扩展为人的笔迹。 它可以被无数的组织,学校,银行甚至家庭活动使用。手写数字焦点将有利于政府机构或任何其他组织识别有助于自动化的公民身份识别范围。 同样,可以通过该系统诊断任何个人的许可证卡数量。 同样,出于学术原因,它也可以用于学生可以使用该系统学习和认识现实世界的解决方案。 同样,通过自动使用该系统,可以使邮政地址,银行支票数字意识变得不那么复杂。

翻译自: https://medium.com/analytics-vidhya/hand-written-digit-recognition-using-cnn-classification-process-explanation-f6d75dcb72bb

使用cnn做手写数字识别

你可能感兴趣的:(python,人工智能,java,机器学习,linux)