← Theo Bui
Imperial College

CNN from Scratch

Java · No libraries · MNIST dataset

Built a convolutional neural network from first principles in Java — no NumPy, no PyTorch, no abstractions. Every matrix operation, every backpropagation step, implemented by hand.

The goal was to truly understand how neural networks function, not just use them. Working directly with the matrices forced a deep understanding of convolution, pooling, and gradient descent.

The implementation is fully configurable: kernel size, stride, pooling method, number of layers, filters, and fully connected nodes are all parameters. Trained and evaluated on MNIST.

GitHub →