Links
Summary
Digit Recognition is a neural network implemented and trained on the MNIST dataset that can recognize handwritten digits. This project was mainly created as an exercise, so the performance is far from optimized. At the end, the network was able to predict handwritten digits with over 90% accuracy. The project has 4 main components
Matrix Library
This project includes its own matrix code which supports some basic matrix operations:
- Apply a function to each element
- Matrix Transpose
- Matrix Addition
- Matrix Subtraction
- Element wise multiplication
- Element wise division
The functionality was not intended to be exhaustive, but rather provide enough functionality to implement the network. The matrix API is also fully unit tested.
MNIST File Reader
The MNIST dataset uses a custom file format to store the training and testing data. This project includes a file reader for that data, as well as a way to preview the datasets visually within the browser.
Neural Network
The neural network is the main feature of this project. There are two main parts that make up the network.
Feed-forward
The feed-forward portion of the network is the part that actually makes the network’s prediction. Initially, when the network is created, the predictions will likely be no better than random guesses. As the network gets trained and ajdusted, these predictions become much better.
Training
This network is trained through iterative back-propogation. The network gets to see the training data, makes a prediction, and then the networks weights and biases are adjusted to make the prediction better.
Web Interface
The network can be interfaced through a web application. In this interface, you can see how the network performs on training data, preview the datasets, as well as interactively draw on an HTML canvas, and have the network try and classify what is drawn.
Languages Used: Typsecript, HTML, CSS
Technologies Used: express, node
Takeaways
This project gave me a lot of insight into the world of machine learning and AI. By implementing all portions of a neural network from scratch (including the matrix math) I was able to understand how the network works at every level.