{"id":27134641,"url":"https://github.com/benjamindettling/digit-classifier","last_synced_at":"2026-05-07T15:32:29.863Z","repository":{"id":286591958,"uuid":"961886998","full_name":"benjamindettling/digit-classifier","owner":"benjamindettling","description":"AI digit classifier app with React frontend and PyTorch + FastAPI backend","archived":false,"fork":false,"pushed_at":"2025-04-07T10:43:39.000Z","size":205,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-07T11:27:19.198Z","etag":null,"topics":["ai","digit-recognition","fastapi","machine-learning","pytorch","react"],"latest_commit_sha":null,"homepage":"https://digit.benjamindettling.ch/","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/benjamindettling.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-04-07T10:17:35.000Z","updated_at":"2025-04-07T10:43:42.000Z","dependencies_parsed_at":"2025-04-07T11:37:26.046Z","dependency_job_id":null,"html_url":"https://github.com/benjamindettling/digit-classifier","commit_stats":null,"previous_names":["benjamindettling/digit-classifier"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benjamindettling%2Fdigit-classifier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benjamindettling%2Fdigit-classifier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benjamindettling%2Fdigit-classifier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benjamindettling%2Fdigit-classifier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/benjamindettling","download_url":"https://codeload.github.com/benjamindettling/digit-classifier/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247755591,"owners_count":20990626,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","digit-recognition","fastapi","machine-learning","pytorch","react"],"created_at":"2025-04-08T00:49:02.620Z","updated_at":"2025-10-28T21:41:29.101Z","avatar_url":"https://github.com/benjamindettling.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🧠 Digit Classifier\n\nDraw digits in your browser and get real-time predictions from a neural network trained on MNIST.  \nBuilt with a **Convolutional Neural Network (CNN)** using **PyTorch**, deployed through a **FastAPI** backend, and accessed via a **React** frontend.\n\n🔗 **Live Demo:** [digit.benjamindettling.ch](https://digit.benjamindettling.ch)\n\n---\n\n## ✨ Features\n\n- 🎨 Interactive canvas for drawing digits (HTML5 Canvas API)\n- 🧠 **CNN model** trained on the MNIST dataset using PyTorch\n- 💾 Model serialized as a `.pth` file and loaded at runtime for inference\n- 📤 Frontend sends base64-encoded images to the backend via POST\n- 🔁 FastAPI backend processes and classifies the input using PyTorch\n- ⚡ Real-time predictions returned via a **REST API**\n- 🌍 Deployed with **Netlify** (frontend) and **Render** (backend)\n- 🚦 Backend served using **Uvicorn**, a lightning-fast ASGI server\n\n---\n\n## 🛠 Tech Stack\n\n**Frontend**\n- React + Vite\n- SCSS Modules\n- HTML Canvas API\n\n**Backend**\n- FastAPI\n- PyTorch (CNN inference)\n- Uvicorn (ASGI server)\n- PIL (image decoding and preprocessing)\n\n---\n\n## 📂 Project Structure\n\n- [`digit-classifier-client`](https://github.com/benjamindettling/digit-classifier-client)  \n  → React app with a canvas-based UI for drawing and submitting digits\n\n- [`digit-classifier-server`](https://github.com/benjamindettling/digit-classifier-server)  \n  → FastAPI backend that loads a serialized PyTorch CNN model and performs digit classification\n\n---\n\n## 📸 Screenshot\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"./digit.jpg\" width=\"400\" alt=\"Digit classifier UI\"/\u003e\n\u003c/p\u003e\n\n---\n\n## 💡 Challenges \u0026 Learnings\n\n- 🧠 Trained my **first neural network** from scratch using PyTorch (CNN architecture)\n- 🔁 Connected a Python-based backend to a modern React frontend\n- 📤 Handled base64 image transmission and decoding between browser and server\n- 🌐 Deployed a full-stack machine learning app using Netlify and Render\n- ⏳ Encountered cold start delays on Render (an ongoing challenge with free-tier hosting)\n\n\u003e This project was a fun deep-dive into ML model deployment, real-time frontend-backend communication, and full-stack integration using modern web tools.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenjamindettling%2Fdigit-classifier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbenjamindettling%2Fdigit-classifier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenjamindettling%2Fdigit-classifier/lists"}