handwritten-digit-recognition

🧠 Handwritten Digit Recognition with CNN

This project demonstrates handwritten digit recognition using a Convolutional Neural Network (CNN) trained on the MNIST dataset.

πŸš€ Project Structure

πŸ› οΈ How to Run

1. Training the Model

Run the training script if you want to retrain the model:

python digit_recognition_model.py

This will create digit_recognition_model.h5.

2. Making Predictions

To predict digits from new images:

python prediction.py

You will be prompted to upload an image (must be 28x28 pixels, grayscale). The script will output the predicted digit along with a plot.

Tip: Use Google Colab if you’re facing hardware limitations.

πŸ§ͺ Example

πŸ”€ Input Image

The user provides a 28x28 grayscale image of a handwritten digit:

Input Digit

βœ… Predicted Output

The model predicts the digit with high accuracy:

Predicted Digit

🧰 Requirements

Install with:

pip install tensorflow numpy matplotlib pillow

πŸ“¦ Dataset

This project uses the MNIST dataset, which is built into TensorFlow.

πŸ“œ License

This project is open-source and free to use under the MIT License.