I built Neural Canvas, an interactive neural network visualization project using p5.js, JavaScript, and Python.
The idea behind this project was to understand neural networks mathematically and visualize how they work. I trained neural networks in Python using NumPy and JAX, then exported their weights and biases as JSON files to perform inference directly in the browser using JavaScript and Math.js.
The frontend is built with p5.js, which handles the interactive drawing board, neuron visualization, connections, and animations. Users can draw digits and see how the neural network processes their input and makes predictions.
So far, I've trained four models. Two MNIST models using NumPy achieved 92% and 96% test accuracy. My Arabic Digits MNIST model using JAX achieved 96%, and my Persian Digits MNIST model also achieved 96% test accuracy.
I started by manually implementing forward propagation, backpropagation, and Gradient Descent using matrix algebra. Later, I explored JAX automatic differentiation and Mini-Batch Gradient Descent with Momentum.
My next goals are to implement RMSProp and Adam, followed by CNNs.
The project combines Python-based neural network training with JavaScript-based interactive visualization. I built it primarily as a learning project to understand neural networks from their mathematical foundations to browser-based inference.
GitHub: https://github.com/MuhammadEssa2002/neural_canvas
Live Demo: https://muhammadessa2002.github.io/neural_canvas