Skip to content

Digit recognition with a twist! This project uses TensorFlow and MNIST to classify digits (0-9) along with their bounding boxes. Enjoy vibrant visualizations and evaluate performance with IoU metrics. ๐ŸŒŸ

License

Notifications You must be signed in to change notification settings

mdowais-39/Digit-Recognition

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

3 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Digit Recognition with Object Detection ๐Ÿš€

Visualize digits with precise bounding boxes using TensorFlow and MNIST!

๐ŸŒŸ Project Overview

Welcome to the Digit Recognition with Object Detection project! This exciting project combines classification and localization to not only identify digits (0-9) but also pinpoint their locations in images using bounding boxes. Built with TensorFlow and the MNIST dataset, it showcases deep learning in action with stunning visualizations of predicted and true bounding boxes, complete with Intersection over Union (IoU) metrics to evaluate performance. ๐ŸŽ‰

๐ŸŽฏ Features

๐Ÿ” Digit Classification: Accurately identifies digits (0-9) using a convolutional neural network.

๐Ÿ“ Bounding Box Localization: Predicts precise coordinates for digit locations in images.

๐Ÿ–ผ๏ธ Visualizations: Displays digits with red (predicted) and green (true) bounding boxes, highlighting classification accuracy and IoU scores.

โš™๏ธ Data Preprocessing: Loads and preprocesses the MNIST dataset with TensorFlow Datasets, padding images to 75x75 and normalizing coordinates.

๐Ÿ“Š Metrics: Evaluates model performance with classification accuracy and IoU for localization.

๐Ÿ› ๏ธ Installation

Get started in just a few steps! ๐Ÿš€

Prerequisites

Python 3.11 or later ๐Ÿ

A passion for machine learning! ๐Ÿ˜„

Steps

Clone the Repository:

git clone (https://github.com/mdowais-39/Digit-Recognition)

cd digit-recognition-object-detection

Set Up a Virtual Environment (recommended)

Install Dependencies:

pip install -r requirements.txt

Dataset Download:

The MNIST dataset is automatically downloaded via TensorFlow Datasets when you run the notebook.

๐Ÿš€ Usage

Dive into the project with these simple steps:

Launch the Jupyter Notebook:

jupyter notebook Object_Detection.ipynb

Explore the Notebook:

๐Ÿ“š Section 1: Imports libraries like TensorFlow, NumPy, Matplotlib, and PIL.

๐Ÿ–Œ๏ธ Section 2: Defines visualization utilities for drawing bounding boxes and displaying digits.

๐Ÿ—‚๏ธ Section 3: Loads and preprocesses the MNIST dataset, padding images and generating normalized bounding box coordinates.

๐Ÿ“ˆ Visualization: Shows predicted vs. true labels with bounding boxes and IoU metrics.

Model Training:

The notebook uses a pre-trained model (model.predict). To train your own, add model definition and training code (see Future Improvements).

Run the notebook to see predictions and visualizations.

Output:

๐Ÿ“ท Visualizations of digits with red (predicted) and green (true) bounding boxes.

๐Ÿ”ด Incorrect predictions are highlighted in red.

๐Ÿ“Š IoU scores indicate localization accuracy (red if below 0.6).

๐Ÿ—ƒ๏ธ Dataset

The project uses the MNIST dataset via TensorFlow Datasets. Images are padded to 75x75 pixels, and bounding box coordinates are normalized for localization tasks.

๐Ÿ“ธ Visualizations

The display_digits_with_boxes function creates stunning visuals:

Digits: Displayed with predicted (red) and true (green) bounding boxes.

Labels: Predicted labels turn red if incorrect.

IoU Scores: Localization accuracy is shown, with low scores (<0.6) in red.

๐Ÿ”ฎ Future Improvements

๐Ÿ› ๏ธ Add model definition and training code for a self-contained notebook.

๐Ÿ”„ Implement data augmentation for improved robustness.

๐Ÿ”ฌ Experiment with advanced architectures like Yoconvolutional neural networks for better localization.

๐Ÿ“ท Support multiple digits per image for real-world applications.

๐Ÿค Contributing

๐Ÿ’ก Follow these steps to contribute:

Fork the repository ๐Ÿด

Create a feature branch (git checkout -b feature-branch)

Commit your changes (git commit -m "Add cool feature")

Push to the branch (git push origin feature-branch)

Open a pull request ๐Ÿš€

๐Ÿ™Œ Acknowledgments

TensorFlow for the awesome deep learning framework.

MNIST Dataset for the classic digit dataset.

TensorFlow Datasets for seamless data loading.

Star this repo if you found it helpful! ๐ŸŒŸ Let's make digit recognition even better together!

About

Digit recognition with a twist! This project uses TensorFlow and MNIST to classify digits (0-9) along with their bounding boxes. Enjoy vibrant visualizations and evaluate performance with IoU metrics. ๐ŸŒŸ

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published