In this repository we implemented the MNIST digit recognition using a simple forward neural network from scratch in Python.
The network is trained by a temporary JAX backpropagation implementation.
- Python installed system wide
- Create a virtual environment and activate it
- Install the required packages using pip:
pip install numpy pillow flask jaxNote: If you are on Windows and have issues with the commands or installing python, ask ChatGPT
- Clone the repository:
git clone https://github.com/tue-ai-club/digit-recognition.gitOr if you don't have git installed, download the ZIP file from the link and extract it.
- Inside the folder run the dowload script to get the MNIST dataset:
python download.py
# or if you want the images to be able to see them:
pyhon download.py --export-png- Initialize the model with:
python initialize_network.py- Train the model with:
python train.py- Run the web app with:
python server.py- Open your browser and go to
http://localhost:6969to use the digit recognition app.
That is it!
You can modify the network parameters in network.py:
# Тук ще дефинирам главните параметри:
network_size = [784, 16, 16, 10]
learning_rate = 0.1
number_of_epochs = 1000
images_to_train_on = 10000You can also change make other changes like adding more data to our small dataset, chaning the activation function (and its derivative!), etc.
Good luck exeprimenting!
