https://github.com/khalidkhankakar/digit-ai
A modern full-stack AI application that recognizes handwritten digits (0–9) using a PyTorch CNN model exported to ONNX, served via FastAPI.
https://github.com/khalidkhankakar/digit-ai
fastapi mnist mnistdataset onnix pytorch react uvicorn
Last synced: 3 days ago
JSON representation
A modern full-stack AI application that recognizes handwritten digits (0–9) using a PyTorch CNN model exported to ONNX, served via FastAPI.
- Host: GitHub
- URL: https://github.com/khalidkhankakar/digit-ai
- Owner: khalidkhankakar
- Created: 2026-06-20T09:39:13.000Z (5 days ago)
- Default Branch: main
- Last Pushed: 2026-06-20T10:20:45.000Z (5 days ago)
- Last Synced: 2026-06-20T11:23:12.989Z (5 days ago)
- Topics: fastapi, mnist, mnistdataset, onnix, pytorch, react, uvicorn
- Language: Jupyter Notebook
- Homepage:
- Size: 1.11 MB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.MD
Awesome Lists containing this project
README
# ✍️ MNIST Digit AI — Handwritten Digit Recognition

---
A modern full-stack AI application that recognizes handwritten digits (0–9) using a **PyTorch CNN model exported to ONNX**, served via **FastAPI**, and visualized through a **Vercel-style React + TypeScript frontend**.
Users can either:
- ✍️ Draw digits on a canvas
- 📤 Upload handwritten digit images
- 🤖 Get real-time AI predictions instantly
---
## 🧠 Tech Stack
### Frontend
- React + TypeScript
- Vite
- Tailwind CSS (v4)
- React Sketch Canvas
- React Dropzone
- Sonner (Toast notifications)
### Backend
- FastAPI
- Uvicorn
- ONNX Runtime
- Pillow (PIL)
- NumPy
### AI Model
- PyTorch CNN (MNIST trained)
- Exported to ONNX for fast inference
---
## ⚙️ Features
### ✍️ Canvas Drawing
- Draw digits using a smooth canvas
- Real-time image export
- AI prediction on button click
### 📤 Image Upload
- Drag & drop support
- Image preview before prediction
- JPG/PNG support
### 🤖 AI Prediction
- ONNX Runtime inference
- Fast response (<100ms locally)
- CNN trained on MNIST dataset
### 🎨 Modern UI
- Vercel-inspired design system (Geist style)
- Clean minimal interface
- Responsive layout
- Soft borders + neutral palette
---
## 🧠 Model Details
- Dataset: MNIST
- Architecture: Convolutional Neural Network (CNN)
- Framework: PyTorch
- Export: ONNX format
- Input shape: `1 × 1 × 28 × 28`
- Output: 10 classes (digits 0–9)
---