Skip to content

A beginner deep learning project using TensorFlow and MNIST to recognize handwritten digits with a Gradio interface. Draw a digit and get real-time predictions with confidence scores. Step before moving on to advanced topics like LLMs.

License

Notifications You must be signed in to change notification settings

rukiyeberna/handwritten-digit-recognition

Repository files navigation

Handwritten Digit Recognition

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.


Features

  • 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

Demo

Screenshot from 2025-08-03 14-13-25


Project Structure

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

Installation

  1. Clone the repository:
git clone https://github.com/rukiyeberna/handwritten-digit-recognition.git
cd handwritten-digit-recognition
  1. Install dependencies:
pip install tensorflow gradio numpy matplotlib

Train the Model

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

Run the Gradio App

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.


Sample Output

Prediction: 6
Confidence: 80.1%


License

This project is licensed under the MIT License.


Author

Developed by rukiyeberna

About

A beginner deep learning project using TensorFlow and MNIST to recognize handwritten digits with a Gradio interface. Draw a digit and get real-time predictions with confidence scores. Step before moving on to advanced topics like LLMs.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published