Defining the problem statement

We are going to tackle the problem of recognizing handwritten digits through a machine learning model that we'll implement in an iOS mobile application. The first step is to have the database of handwritten digits that can be used for model training and testing.

The MNIST digits dataset (http://yann.lecun.com/exdb/mnist/) provides a database of handwritten digits, and has a training set of 60,000 examples and a test set of 10,000 examples. It is a subset of a larger set that's available from MNIST. The digits have been size-normalized and centered in a fixed-size image. It is a good database for people who want to learn techniques and pattern recognition methods on real-world data while exerting minimal effort on preprocessing and formatting.

Before solving this problem, we will spend some time understanding the problem to see where the neural network can help. We can split the problem of recognizing handwritten digits into two sub-problems. Suppose we are given a handwritten number, as follows:

First, we need to break an image containing many digits into a sequence of separate images, each containing a single digit. For example, we'd like to break this image into seven separate images, as shown here:

For humans, the digits can be easily separated, but it is very challenging for machines to do this simple task. Once the digits are separated, the program needs to classify each individual digit. So, for instance, we'd like our program to recognize that the first digit is a 5.

We are now trying to focus on the second part of the problem: to recognize the individual digits and classify them. We are going to use a neural network to solve the problem of recognizing individual, handwritten digits.

We can solve this problem using a 3-layer neural network, with the output layers having 10 neurons. The input layer and the hidden layers are where the processing happens. in the output layer, based on the neuron that fires, we can easily infer the digit that was recognized. Neurons 0 to 9 each identify one digit.

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

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