DigitVision is a full-stack deep learning web application that recognizes handwritten digits (0โ9) in real time using a Convolutional Neural Network (CNN) trained on the MNIST dataset.
It combines the power of TensorFlow/Keras for digit recognition with a modern Flask + HTML/CSS/JS frontend for an interactive experience.
๐ Try it now: https://huggingface.co/spaces/debjani31/DigitVision
(Draw any digit from 0โ9 and see real-time predictions!)
DigitVision demonstrates how deep learning and web development can merge into a powerful AI application.
It uses a CNN model trained with ~99% accuracy on the MNIST dataset and deploys it through Flask, wrapped in a visually engaging user interface.
โ
Real-time digit prediction through canvas drawing
โ
Upload your own digit images for recognition
โ
Interactive tools (pencil, eraser, clear canvas)
โ
Confidence score display for predictions
โ
Clean neon-themed UI with animations
โ
User Sign-in / Sign-up pages (UI ready for backend integration)
- Dataset: MNIST Handwritten Digits
- Input Shape:
28 ร 28 ร 1grayscale images - Architecture:
- Conv2D (32) โ Conv2D (32) โ MaxPooling2D โ Dropout
- Conv2D (64) โ Conv2D (64) โ MaxPooling2D โ Dropout
- Flatten โ Dense(256) โ Dropout โ Dense(10, Softmax)
- Optimizer: Adam
- Loss Function: Categorical Crossentropy
- Accuracy: ~99% (validation)
Model trained on Kaggle and saved as mnist_cnn_model.h5 for deployment.
- Uploaded as digit-recogni.ipynb
- Also get the direct access of the kaggle notebook : https://www.kaggle.com/code/debjanitiya/digit-recogni
| Layer | Technology |
|---|---|
| Frontend | HTML, CSS, JavaScript, Bootstrap |
| Backend | Flask (Python) |
| Deep Learning | TensorFlow, Keras |
| Image Processing | OpenCV, Pillow |
| Deployment | Hugging Face Spaces (Docker + Python) |
git clone https://github.com/debjani31/DigitVision.git
cd DigitVisionpip install -r requirements.txtpython app.pyAccess it at โ http://localhost:5000
- Launch the app or visit the live Hugging Face demo
- Sign in or Sign up (UI available)
- Use the canvas to draw a digit or upload one
- Click Predict Digit
- View predicted number + confidence score instantly ๐ฏ
DigitVision/
โ
โโโ app.py # Flask backend & model routes
โโโ mnist_cnn_model.h5 # Trained CNN model
โโโ requirements.txt # Dependencies
โโโ website/ # Frontend HTML templates
โ โโโ layout.html
โ โโโ home.html
โ โโโ sign.html
โ โโโ static/ (CSS, JS, images)
โโโ README.md
-
User draws or uploads a digit
-
Image is sent to Flask backend
-
Preprocessed with OpenCV:
- Grayscale conversion
- Inversion (white digit on black background)
- Cropping and centering
- Resizing to 28ร28
- Normalization (0โ1)
-
Model predicts the digit and confidence
-
Result displayed in the frontend instantly
- ๐งฉ Add Firebase or SQL-based authentication
- ๐ฑ Make fully responsive for mobile devices
- ๐ง Train on EMNIST for letters + digits
- โ๏ธ Auto-deploy with CI/CD (GitHub Actions)
Debjani Mandal ๐ Machine Learning & Web Developer Enthusiast ๐ Live App on Hugging Face ๐ป Project: DigitVision โ Handwritten Digit Recognition using CNN
This project is licensed under the MIT License. Feel free to fork, modify, and build upon it for your own learning or research.