A convolutional neural network written from scratch in NumPy, and a window into every layer.
- role
- Solo build
- status
- Live
- when
- 2026
- ownership
- Solo
Who did what. Personal project.
Overview
No PyTorch, no TensorFlow: every convolution, activation, pooling step and gradient is hand-written in NumPy and trained on MNIST. A React interface lets you draw a digit and watch the network's feature maps light up as it classifies.
Why it exists
Frameworks make CNNs easy to use and hard to see. Writing backpropagation by hand is the most direct way to understand what a model is actually doing, and visualising it makes that understanding shareable.
My part
- Implemented convolution (16 filters, 3×3), ReLU, max pooling, dense layers and backpropagation from scratch in NumPy.
- Trained on MNIST and served predictions with FastAPI.
- Built a React interface: a drawing canvas, live probabilities, feature maps, an architecture graph and a step-by-step data pipeline.
How it works
- a
28×28 input
Canvas drawing normalised to MNIST format.
- b
Conv 16×3×3
16 learnable filters produce 16 feature maps of 26×26.
- c
ReLU + pool
Non-linearity and downsampling.
- d
Dense
Hidden neurons to 10 class scores.
- e
Softmax
Live probabilities back to the interface.
Shapes through the network
Every arrow in this diagram is code I wrote by hand: the convolution loops, the ReLU mask, the pooling indices and the gradients flowing back through all of them.
Built with
- NumPy
- FastAPI
- React
- Python
Status & next
Hosted on a free tier, so the first prediction after idle can take about 30 s to wake.
Source: github.com/AA-KH/Handwritten-Digits-Classifier