Skip to content

PankajKumar-11/-Handwritten-Digit-Recognition-MNIST-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

21 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

✍️ Handwritten Digit Recognition (MNIST)

This project uses a Convolutional Neural Network (CNN) trained on the MNIST dataset to recognize handwritten digits (0–9). It includes both a Jupyter notebook for training and testing the model and a Python Tkinter GUI app that allows users to draw digits and see real-time predictions.

Sample Output


πŸ“¦ What's Included

  • 🧠 Model Training Notebook – Builds and trains a CNN using TensorFlow/Keras on MNIST
  • πŸ–ΌοΈ Interactive GUI (Tkinter) – Lets you draw a digit and predicts it using the trained model
  • πŸ“ Pre-trained Model – Saved as mnist_cnn_model.keras (used by the GUI)

🧠 About the Dataset

  • MNIST Dataset:
    • 70,000 grayscale images of handwritten digits (28Γ—28)
    • 60,000 training + 10,000 testing samples
    • Classes: Digits 0–9

🧰 Tech Stack

  • Python
  • Jupyter Notebook
  • TensorFlow / Keras
  • Tkinter (GUI)
  • NumPy, Pillow, Matplotlib

πŸ—οΈ Project Structure

β”œβ”€β”€ mnist_model_training.ipynb (Notebook for model training and evaluation)
β”œβ”€β”€ digit_gui_predictor.py (GUI app to draw and predict digits)
β”œβ”€β”€ mnist_cnn_model.h5 (Saved trained CNN model)
β”œβ”€β”€ requirements.txt (Python dependencies)
└── assets/ ((optional) Sample images or outputs)


πŸš€ Setup Instructions

1. Clone the Repository

git clone https://github.com/Pankaj97825/-Handwritten-Digit-Recognition-MNIST-.git
cd -Handwritten-Digit-Recognition-MNIST-

2.Install Requirements

pip install -r requirements.txt

Or manually:

pip install tensorflow numpy matplotlib pillow

✍️ Run the GUI Application

python draw_digit_ui.py
  • A window will appear where you can draw a digit with your mouse.

  • Click "Predict" to classify it.

  • Click "Clear" to draw a new one.

Make sure mnist_cnn_model.h5 is in the same directory!


πŸ“ˆ Sample Output

You can expect predictions like:

Prediction: 2 (Confidence: 0.99)

And a GUI like this:

Sample Output


πŸ“„ License

This project is open-source and available under the MIT License.


πŸ™‹β€β™‚οΈ Author

Pankaj Kumar
GitHub: @PankajKumar-11

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published