A handwritten digit identifier built from scratch using Python and NumPy.
This project trains a simple neural network on MNIST-style digit data and predicts digits from a 28x28 image input. The model logic is implemented manually without using PyTorch or TensorFlow.
- Neural network built from scratch using NumPy
- Manual forward propagation
- ReLU activation
- Softmax output layer
- One-hot encoding
- Backpropagation
- Gradient descent
- Model parameter saving using
.npz - Local image-based digit prediction
- Popup result display
DigitIdentifier/
├── data/
│ └── mnist.npz
│
├── mainNeuralNetwork/
│ ├── main.py
│ └── app.py
│
├── digit.png
└── README.md
main.py trains the neural network and saves the learned parameters:
w1, b1, w2, b2
These parameters are stored in:
data/mnist.npz
app.py loads the saved model parameters, reads digit.png, converts it into a 28x28 normalized input, runs forward propagation, and displays the predicted digit in a popup.
Install the required packages:
pip install numpy pandas pillow matplotlibTrain the model:
python mainNeuralNetwork/main.pyRun digit prediction:
python mainNeuralNetwork/app.pyThe model reached around 95% training accuracy.
This project was built to understand the internal working of neural networks, including forward propagation, backpropagation, gradient descent, and parameter updates.