After building a simple neural network that recognizes handwritten digits (0-9) from scratch using GitHub Codespaces, Claude Opus 4.5, and the MNIST dataset, this repo was given to Claude Code with a mandate to improve the model.
Result: Model accuracy improved from ~80% to 98.5% on MNIST test set through basic modern deep learning techniques.
- Input: 784 pixels (28x28 grayscale image)
- Hidden layers: 4 layers with 512 → 384 → 256 → 128 neurons
- Output: 10 neurons (digits 0-9) with softmax
- Activation: ReLU with 30% dropout
- Initialization: He initialization for improved gradient flow
- Mini-batch SGD (batch size 128) with data shuffling
- Learning rate scheduling with decay at 50%, 70%, and 90% of training
- 80 epochs with validation monitoring
- Dropout regularization to prevent overfitting
network.py- Deep neural network class with forward/backward passtrain.py- Data loading, training loop with validationpredict.py- Image preprocessing and prediction with test-time augmentation
MNIST - 70,000 labeled images of handwritten digits (28x28 grayscale)
- Python 3.x
- NumPy
- Pillow
- SciPy