This project features a handwriting recognition system powered by a Convolutional Neural Network (CNN), built using TensorFlow and Keras. It is designed to accurately recognize handwritten digits, leveraging data from the MNIST dataset.
The graph below shows the training and validation accuracy of the model :
-
Train a CNN model on the MNIST dataset.
-
Save and load the trained model.
-
GUI for loading images and drawing digits on a canvas.
-
Real-time prediction of handwritten digits with confidence scores.
-
Visualization of training history and predictions.
-
Clone the repository:
git clone https://github.com/soroqn1/Digit-Recognition cd Digit-Recognition
-
Install the required dependencies:
pip install -r requirements.txt
-
Run the
general.py
script to train the model:python general.py
-
The trained model will be saved as
models/handwriting_recognition_model.h5
.
-
Run the
gui.py
script to start the GUI application:python gui.py
-
Use the GUI to load an image or draw a digit on the canvas for prediction.
general.py
: Script for training the CNN model on the MNIST dataset.gui.py
: Script for the GUI application to load images and draw digits for prediction.requirements.txt
: List of required Python packages.
This project is licensed under the MIT License. See the LICENSE file for details.
- The MNIST dataset is provided by Yann LeCun and Corinna Cortes.
- TensorFlow and Keras are open-source libraries developed by the TensorFlow team.