This Python project implements a Handwritten Digit Recognition Application using a Convolutional Neural Network (CNN) built with Keras. The application allows users to draw digits on a canvas ✍️, which are then recognized by the trained model 🤖. The model is trained on the MNIST dataset with around 99.93% accuracy 🎯, which contains images of handwritten digits 🧑🎨
- User -Friendly Interface: Draw digits easily on a digital canvas 🎨🖥.
- Real-Time Recognition: Instantly recognize the drawn digit with high accuracy 🔍.
- Interactive Experience: Engage with the application and see your drawings come to life! 👩🎤
- Draw digits on a canvas 🖌️🎨.
- Recognize the drawn digit using a pre-trained CNN model 🧠.
- Display the predicted digit and confidence percentage 📈.
- Clear the canvas with a button 🧹🔄.
This section showcases key moments of the handwritten digit recognition application in action. Each screenshot highlights a specific feature of the application, providing a visual representation of its functionality. 🌟
Description: This screenshot captures the initial state of the application, featuring the logo and user instructions. It provides users with a clear understanding of how to interact with the application upon launch. 🖥️✨
Description: This screenshot illustrates a user actively drawing a digit on the canvas. It demonstrates the intuitive interface that allows for seamless user interaction, showcasing the application's capability to capture handwritten input. ✍️🖌️
Description: This screenshot displays the outcome after the user clicks the "Recognize" button. It shows the predicted digit along with the confidence percentage, highlighting the model's performance and accuracy in recognizing handwritten digits. 📊🤖
To get your project up and running, follow these steps:
Make sure you have Python installed on your machine. You will also need to install the required packages listed in requirements.txt
.
Clone the repository to your local machine using the following command:
git clone https://github.com/MohammadAshmir786/Handwritten_Digit_Recognition.git
Change into the project directory:
cd Handwritten_Digit_Recognition
Make sure you have all the required packages installed. Run the following command to install the dependencies:
pip install -r requirements.txt
Start the application by executing:
python digit_recognition_app.py
- Draw a digit on the canvas.
- Click the "Recognize" button to see the prediction!
- Use the "Clear" button to clear the canvas and Draw again.
Important
Before running the training model or the recognition application, replace the placeholder "absolute path to the saved model"
in the code with the actual absolute path to your saved model 🛠️🔑.
The model is trained on the MNIST dataset. The training process involves the following steps:
- Load the MNIST dataset.
- Preprocess the images (normalize and reshape).
- Build the CNN model.
- Compile and train the model using callbacks for early stopping and model checkpointing.
- Save the best model as
best_model.keras
. - The model achieves an accuracy of around 99.93% on the MNIST test set.
The CNN model consists of:
- Two convolutional layers followed by max pooling layers.
- A flattening layer.
- A dense layer with dropout for regularization.
- An output layer with softmax activation for multi-class classification.
Contributions are welcome! If you have suggestions for improvements or new features, please open an issue or submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
- Kerasfor the deep learning framework.
- MNIST Dataset for providing the handwritten digit dataset.
For any inquiries or feedback, feel free to reach out to me at mail
Thank you for exploring this project! Enjoy recognizing your handwritten digits! 🎉