Skip to content

The Handwritten Digit Recognition System uses AI to identify handwritten digits through an image upload or an interactive writing pad. It leverages a trained CNN model on the MNIST dataset for accurate real-time predictions. πŸš€

Notifications You must be signed in to change notification settings

jyotiska222/DigitRecognitionModel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ–οΈ Handwritten Digit Recognition System

This project allows users to recognize handwritten digits using a deep learning model (CNN) trained on the MNIST dataset.
Users can either:
βœ”οΈ Upload an image of a digit
βœ”οΈ Draw on a writing pad and get instant predictions


✨ Features

βœ… Image Upload – Choose an image of a digit and get a prediction
βœ… Interactive Writing Pad – Draw a digit using a mouse
βœ… Clear Canvas (Press 'C') – Erase and redraw without restarting
βœ… Predict Digit (Press 'P') – Get the result instantly
βœ… Quit (Press 'Q') – Exit the writing pad


πŸ› οΈ Installation

  1. Clone the repository:

    git clone https://github.com/your-username/handwritten-digit-recognition.git
    cd handwritten-digit-recognition
  2. Install dependencies:

    pip install opencv-python numpy tensorflow tkinter
  3. Download the trained model:

    • Place the pre-trained handwriting_model.h5 inside the models/ directory.

πŸš€ Usage

Run the program using:

python main.py

You’ll see a menu asking you to:
1️⃣ Upload an image
2️⃣ Draw on a writing pad

For Image Upload:

  • Select an image (.png, .jpg, .jpeg) containing a digit.
  • The system will process and display the predicted digit.

For Writing Pad:

  • Draw a digit using your mouse.
  • Press 'C' to clear and redraw.
  • Press 'P' to predict the drawn digit.
  • Press 'Q' to exit.

πŸ“‚ Project Structure

πŸ“‚ handwritten-digit-recognition
│── πŸ“‚ models
β”‚   └── handwriting_model.h5       # Pre-trained CNN model
│── digit_recognition.py           # Main program to Train & Run the Model
│── realtime_digit_recognition.py  # Program to Acces the Local File & Writting Pad
│── README.md                      # Project documentation

🧠 How It Works

  • Image Processing: Converts images to grayscale, resizes (28x28), normalizes, and inverts colors.
  • CNN Model Prediction: Trained on MNIST dataset, predicts digit with softmax classification.
  • OpenCV GUI: Provides an interactive writing pad for drawing digits.

πŸ–₯️ Demo

πŸ“Έ Screenshot 2: Writing Pad in Action

Screenshot 2025-02-15 174001

πŸ“Έ Screenshot 3: Image Upload Prediction

Screenshot 2025-02-15 173810


🀝 Contributing

Want to improve this project? Feel free to fork and submit a pull request!


πŸ“œ License

This project is open-source and free to use! πŸš€

About

The Handwritten Digit Recognition System uses AI to identify handwritten digits through an image upload or an interactive writing pad. It leverages a trained CNN model on the MNIST dataset for accurate real-time predictions. πŸš€

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages