An end-to-end Deep Learning project that classifies handwritten digits (0-9) from the famous MNIST dataset using a Multi-Layer Perceptron (MLP) built with TensorFlow and Keras.
- High Accuracy: Reached over 97.83% accuracy on the test dataset.
- Balanced Architecture: Optimized using a
Dropoutlayer to robustly eliminate overfitting. - Production-Ready: Saves the trained model pipeline into a reusable
.kerasformat. - Verification Built-In: Performs automated script tests comparing real sample labels directly with inference predictions.
The MNIST dataset is automatically loaded and handled within the script:
-
Training Set: 60,000 images (
$28 \times 28$ pixels) -
Test Set: 10,000 images (
$28 \times 28$ pixels) -
Features Scaling: Pixel values normalized from
[0, 255]to[0.0, 1.0]for optimal gradient descent stability.
The model is sequentially structured as follows:
-
Flatten Layer: Reshapes the 2D image matrix (
$28 \times 28$ ) into a flat 1D array of 784 pixels. -
Dense Hidden Layer: 128 neurons utilizing the
ReLUactivation function. - Dropout Layer: Randomly drops out 20% of nodes during training epochs to boost generalization.
-
Dense Output Layer: 10 neurons mapping out multi-class probability scores via
Softmax.