Welcome to my MNIST Hand-Drawn Digit Recognition project. This project focuses on training a deep learning model on the MNIST dataset and provides a user-friendly interface for real-time digit recognition.
-
Jupyter Notebooks:
MNIST_Training_Notebook.ipynb
: This notebook contains the entire process of training the model on the MNIST dataset.MNIST_EDA_Notebook.ipynb
: Use this notebook for an in-depth exploratory data analysis of the MNIST dataset.
-
Python Scripts:
train_main.py
: The main script for training the model on the MNIST dataset.gui.py
: This script launches the tkinter-based GUI for real-time digit recognition and contains functions to process and recognize hand-drawn digits.model.py
: Defines the architecture and parameters of the neural network model.visualization.py
: Utilities for visualizing dataset samples, training results, and more.training.py
: Contains utilities and helper functions for model training.data_utils.py
: Helpful utilities for loading and processing the MNIST dataset.
-
Ensure you have all the necessary libraries installed.
pip install requirements.txt
-
Ensure you have training data MNIST in
./data
folder. -
Run the
train_main.py
script to train the model:python train_main.py
The application provides an intuitive interface for users to draw digits and instantly get predictions from the trained model.
Steps:
-
Ensure the trained model is saved in the correct directory or specify the path to the trained model (e.g.,
./saved_models/mnist_model.pth
). -
Start the tkinter app by running the following command in your terminal or command prompt:
python gui.py
-
Once the application window opens, use your mouse to draw a digit on the canvas.
-
Click on the "Predict" button. The application will process the drawn digit and display the predicted value.
-
To clear the canvas and draw a new digit, click on the "Clear" button.