A beginner-friendly deep learning project using TensorFlow and the MNIST dataset to recognize handwritten digits (0-9). Includes an interactive Gradio interface to draw digits and see real-time predictions with confidence scores.
- MNIST dataset
- Draw digits in browser using Gradio
- Real-time predictions with confidence level
- Modular structure for training, testing, and inference
- Model is saved and loaded using
.h5
format
handwritten-digit-recognition/
├── explore_mnist.py # MNIST dataset exploration
├── mnist_model_train.ipynb # Model training notebook
├── model_test.py # Model testing script
├── mnist_gradio_digit_classifier.ipynb # Gradio interface for prediction
├── LICENSE
└── README.md
- Clone the repository:
git clone https://github.com/rukiyeberna/handwritten-digit-recognition.git
cd handwritten-digit-recognition
- Install dependencies:
pip install tensorflow gradio numpy matplotlib
If you'd like to train the model yourself, open the notebook:
jupyter notebook mnist_model_train.ipynb
After training, the model is saved as:
model.save("mnist_model.h5")
This .h5
file includes:
- Model architecture
- Trained weights
- Optimizer state
- Training configuration
Launch the web interface to draw digits:
jupyter notebook mnist_gradio_digit_classifier.ipynb
Then click the Gradio link to open the digit prediction UI in your browser.
Prediction:
6
Confidence:80.1%
This project is licensed under the MIT License.
Developed by rukiyeberna