WebGPU MNIST Demo

A neural network trained entirely in-browser using WebGPU compute shaders.

Interactive Digit Recognizer

Draw digits with your mouse and watch the pre-trained model predict in real-time. Visualizes data flowing through each layer of the neural network as you draw.

Requires a modern browser with WebGPU support. Mobile would probably be unusable.

Train and Test

Train the MNIST model from scratch in your browser. Runs the full training loop on the 60,000 training images, then evaluates accuracy on the 10,000 test images.

Runs 15 epochs with batch size 32. On M3 Max: ~8 minutes. With batch size 64: ~4 minutes. Can be trained in my iPhone 15 Pro.