This project demonstrates how to classify handwritten digits (0 to 9) from the MNIST dataset using a multi-layer perceptron (MLP), a basic form of an Artificial Neural Network (ANN).
Given an image of a handwritten digit (28x28 grayscale), predict the correct digit label (0β9).
- Multi-Layer Perceptron (MLP)
- Softmax Output Layer
- Cross-Entropy Loss
- ReLU Activation
- Data Normalization
- One-Hot Encoding
- Model Evaluation
| Layer | Type | Units | Activation |
|---|---|---|---|
| Input | Flatten | 784 | - |
| Hidden 1 | Dense | 128 | ReLU |
| Hidden 2 | Dense | 64 | ReLU |
| Output | Dense | 10 | Softmax |
train.ipynb: Model building, training, evaluation, and accuracy plotsmodel.ipynb: Modular version with prediction and visualizationmlp_weights.h5: (optional) for loading pretrained weights
- Training Accuracy: ~98%
- Test Accuracy: ~97%
- Fast convergence with only 10 epochs