MNIST Neural Network from Scratch

A neural network that recognizes handwritten digits with 98% precision

Objective: Build a neural network from scratch for the MNIST database.

  • Built from scratch with numpy
  • Optimized neural network with 98% precision after 20 epochs of training
  • Major changes from v1:
    • Switched from batch gradient descent to mini-batch gradient descent
    • Added momentum to descent algo
    • Better initialization of weights


Sample digits from the MNIST database (left) and a simple visual of how the neural network trains on them (right).

(Ali, 2024) contains python code for both v1 and v2 of the neural network.

Helpful Resources





References

2024

  1. MNIST Network From Scratch - Github Repository
    Yusuf Ali
    2024

2018

  1. Building a Neural Network from Scratch
    Johnathan Weisberg
    2018

1994

  1. The MNIST Database of handwritten digits
    Y. LeCunn, C. Cortes, and C. J.C. Burges
    1994