gitmyhub

Text-Detection-using-Neural-Network

Jupyter Notebook ★ 0 updated 19d ago

A convolutional neural network (CNN) that recognises handwritten digits (0–9), with a live webcam demo that classifies digits in real time

A convolutional neural network that recognizes handwritten digits 0-9 in real time through a live webcam demo, with a pre-trained model included.

PythonTensorFlowKerasOpenCVsetup: easycomplexity 2/5

This project teaches a computer to recognize handwritten digits from zero to nine and demonstrates it live using a webcam, so you can hold up a piece of paper with a number written on it and watch the program guess which digit it is in real time, along with how confident it is in that guess.

Under the hood it uses a type of neural network called a convolutional neural network, or CNN, which is especially good at recognizing patterns in images. The model learns from about ten thousand sample images of handwritten digits, split evenly across all ten possible digits. Before training, each image is resized to a small standard size, converted to grayscale, and adjusted so its contrast is more consistent, which helps the model learn more reliably. The training data is also artificially varied through small shifts, zooms, and rotations, a common trick that helps the model handle real-world handwriting that will not look exactly like the training examples.

A version of the trained model is already included, so you do not need to train anything yourself just to try the webcam demo. The author notes this project was originally built back in 2021 as an early personal learning project, and has now been shared publicly with the original files preserved untouched, alongside an updated version that runs on current versions of the deep learning libraries involved, since older versions have since changed compatibility.

To use it, you clone the repository, install a handful of Python packages, and run one script to launch the live webcam demo, or a second script if you want to retrain the model from scratch on the included dataset. The author suggests possible future improvements, like extending the system to recognize full letters instead of only digits, reading whole handwritten words rather than one character at a time, and building a simpler web-based demo that would not require a webcam at all.

Where it fits