Downloads · 30 days
7
29% of all-time downloads
Madhav073/mnist-digit-classifier
mnist-digit-classifier is a machine learning model from Madhav073. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for keras.
A simple yet effective neural network built using TensorFlow and Keras to classify handwritten digits (0–9) from the MNIST dataset.
Downloads · 30 days
7
29% of all-time downloads
All-time downloads
24
Public
Repo size
201 MB
Likes
0
Public
Click a slice to open those files.
.csv185 MB · 91%
From the Hugging Face model README
A simple yet effective neural network built using TensorFlow and Keras to classify handwritten digits (0–9) from the MNIST dataset.
This project serves as a beginner-friendly example of training, evaluating, and publishing a machine learning model on the Hugging Face Model Hub.
| Property | Value |
|---|---|
| Framework | TensorFlow / Keras |
| Model Type | Feedforward Neural Network (Fully Connected) |
| Dataset | MNIST |
| Input Shape | (784,) |
| Output Classes | 10 (Digits 0–9) |
| Training Accuracy | 98.24% |
| Test Accuracy | 96.86% |
Input Layer (784)
│
▼
Dense (128 neurons, ReLU)
│
▼
Dense (64 neurons, ReLU)
│
▼
Dense (10 neurons, Softmax)
The model was trained on the MNIST Handwritten Digits Dataset, containing:
Each image is flattened into a 784-dimensional vector before being passed into the neural network.
The following preprocessing steps were applied:
| Metric | Score |
|---|---|
| Training Accuracy | 98.24% |
| Test Accuracy | 96.86% |
The small gap between training and test accuracy indicates that the model generalizes reasonably well on unseen data.
import tensorflow as tf
model = tf.keras.models.load_model("mnist_classifier.keras")
import numpy as np
import tensorflow as tf
model = tf.keras.models.load_model("mnist_classifier.keras")
# image should be normalized and reshaped
image = image.reshape(1, 784)
prediction = model.predict(image)
predicted_digit = np.argmax(prediction)
print(predicted_digit)
Install dependencies:
pip install tensorflow numpy
.
├── mnist_classifier.keras
├── README.md
This model is intended for:
This project is released under the MIT License, allowing free use, modification, and distribution.
Madhav Maheshwari
If you find this project useful, consider giving it a ⭐ on Hugging Face.