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.
- π§ 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)
- MNIST Dataset:
- 70,000 grayscale images of handwritten digits (28Γ28)
- 60,000 training + 10,000 testing samples
- Classes: Digits 0β9
- Python
- Jupyter Notebook
- TensorFlow / Keras
- Tkinter (GUI)
- NumPy, Pillow, Matplotlib
βββ 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)
git clone https://github.com/Pankaj97825/-Handwritten-Digit-Recognition-MNIST-.git
cd -Handwritten-Digit-Recognition-MNIST-pip install -r requirements.txtOr manually:
pip install tensorflow numpy matplotlib pillowpython 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!
You can expect predictions like:
Prediction: 2 (Confidence: 0.99)
And a GUI like this:
This project is open-source and available under the MIT License.
Pankaj Kumar
GitHub: @PankajKumar-11

