This project implements a fully connected neural network from scratch (using only NumPy) to recognize handwritten digits from the MNIST dataset.
No deep learning frameworks like TensorFlow or PyTorch are used — everything from forward propagation to backpropagation is coded manually.
A simple fully connected feedforward neural network with one hidden layer.
- Manual coding of forward propagation, backpropagation, and gradient descent.
- No use of high-level deep learning libraries—everything is written from scratch in NumPy
- Achieved an accuracy of approximately 85%
- Built a multi-layer neural network (with activation functions, loss function, and gradient descent).
- Trained on the MNIST dataset (28x28 pixel handwritten digits).
- Achieved good accuracy without using high-level ML libraries.
- Visualized training performance and predictions.
- Load and preprocess MNIST data ( train/test split).
- Define model architecture:
- Input layer (784 nodes for 28×28 pixels)
- Hidden layer (configurable, e.g., 128 neurons)
- Output layer (10 neurons for digits 0–9)
- Initialize weights and biases randomly.
- Implement forward pass:
- Hidden activations (ReLU)
- Output layer (softmax)
- Implement backpropagation:
- Compute gradients using chain rule
- Use cross-entropy loss
- Train with gradient descent, updating weights over epochs, and print accuracy logs (e.g., every 10 iterations)