Digital Number Recognition

Overview


This example demonstrates using tensor-flow to create a neural network that learns to recognize the digits 1,2,3,4,5,6,7,8,9. Each digit can be represented as a set of pixels, and the goal of the exercise is to train a machine learning algorithm to recognize each digit from its pixels.

For this example, we will use simple representations of each digit, displayed below.



These digits are an obvious simplification. In fact, it is fairly easy to write a function that would recognize these characters without having to use machine learning, however, we use this simplification in order to easily demonstrate the concepts.

Representation


The digits are encoded as arrays of arrays. The following shows how the digit seven is encoded.


let matrix7 = [
  [1,1,1,1],
  [0,0,0,1],
  [0,0,1,0],
  [0,1,0,0],
  [1,0,0,0]
];
					


Video Demos


Video Demo
A full copy of the desktop used in this example can be found here:

full desktop

Next Steps


The first step is to flatten the data into a format that can be fed into a machine learning model.