A convolutional neural network written from scratch in NumPy, and a window into every layer.

role
Solo build
status
Live
when
2026
ownership
Solo
neuralvis.cnnAI research · Data & ML engineering
012345678928×28 → conv 16×3×3 → relu → pool → dense → softmax

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

  1. a

    28×28 input

    Canvas drawing normalised to MNIST format.

  2. b

    Conv 16×3×3

    16 learnable filters produce 16 feature maps of 26×26.

  3. c

    ReLU + pool

    Non-linearity and downsampling.

  4. d

    Dense

    Hidden neurons to 10 class scores.

  5. e

    Softmax

    Live probabilities back to the interface.

Shapes through the network

input

1 × 28 × 28

conv

16 × 26 × 26

relu

16 × 26 × 26

pool

16 × 13 × 13

dense

hidden

softmax

10

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