{"id":27471064,"url":"https://github.com/sidsurakanti/mnist-classification","last_synced_at":"2026-05-14T22:32:29.593Z","repository":{"id":287495771,"uuid":"964924773","full_name":"sidsurakanti/mnist-classification","owner":"sidsurakanti","description":"realtime handwritten digit recognition \u0026 mnist digit classification from scratch w/ only maths and numpy ","archived":false,"fork":false,"pushed_at":"2025-08-02T05:24:40.000Z","size":15974,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-02T08:18:21.781Z","etag":null,"topics":["classification","math","ml","mnist","numpy"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","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/sidsurakanti.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,"zenodo":null}},"created_at":"2025-04-12T03:29:25.000Z","updated_at":"2025-08-02T05:24:44.000Z","dependencies_parsed_at":"2025-04-26T04:30:33.469Z","dependency_job_id":null,"html_url":"https://github.com/sidsurakanti/mnist-classification","commit_stats":null,"previous_names":["sidsurakanti/mnist-digit-recog","sidsurakanti/mnist-classification"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sidsurakanti/mnist-classification","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sidsurakanti%2Fmnist-classification","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sidsurakanti%2Fmnist-classification/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sidsurakanti%2Fmnist-classification/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sidsurakanti%2Fmnist-classification/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sidsurakanti","download_url":"https://codeload.github.com/sidsurakanti/mnist-classification/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sidsurakanti%2Fmnist-classification/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33045580,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T13:14:54.681Z","status":"online","status_checked_at":"2026-05-14T02:00:06.663Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["classification","math","ml","mnist","numpy"],"created_at":"2025-04-16T01:38:22.853Z","updated_at":"2026-05-14T22:32:29.587Z","avatar_url":"https://github.com/sidsurakanti.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Overview\r\nMNIST digit classifier built with just NumPy and Math. It also has a Pytorch + a realtime web implementation using FastAPI and Next.js. \r\n\r\n\u003cimg src=\"/assets/mnistdemo.gif\"\u003e\r\n\u003ctable\u003e\r\n  \u003ctr\u003e\r\n    \u003ctd\u003e\u003cimg src=\"/performance.png\" width=\"400px\"\u003e\u003c/td\u003e\r\n    \u003ctd\u003e\u003cimg src=\"/confusion_matrix.png\" width=\"400px\"\u003e\u003c/td\u003e\r\n  \u003c/tr\u003e\r\n\u003c/table\u003e\r\n\r\n## What I learned\r\n\r\n- How to implement a neural net from scratch  \r\n- Forward and backward propagation using pure math\r\n- Vectorized operations with NumPy  \r\n- Loss functions, softmax, and gradient descent\r\n- Data normalization, preprocessing, and augumentation\r\n- Visualizing model performance (loss, accuracy, confusion matrix)\r\n- Optimizing data pipeline\r\n- Pytorch\r\n- Full-stack integration with FastAPI and Next.js\r\n\r\n## Stack\r\n\r\n![Python](https://img.shields.io/badge/python-%2314354C.svg?style=for-the-badge\u0026logo=python\u0026logoColor=white)\r\n![NumPy](https://img.shields.io/badge/numpy-%23013243.svg?style=for-the-badge\u0026logo=numpy\u0026logoColor=white)\r\n![Matplotlib](https://img.shields.io/badge/matplotlib-2067b8?style=for-the-badge\u0026logo=matplotlib\u0026logoColor=white)\r\n![Pandas](https://img.shields.io/badge/pandas-150458?style=for-the-badge\u0026logo=pandas\u0026logoColor=white)\r\n![PyTorch](https://img.shields.io/badge/pytorch-%23ee4c2c.svg?style=for-the-badge\u0026logo=pytorch\u0026logoColor=white)\r\n![FastAPI](https://img.shields.io/badge/fastapi-005571?style=for-the-badge\u0026logo=fastapi)\r\n![Next.js](https://img.shields.io/badge/next.js-000000?style=for-the-badge\u0026logo=next.js\u0026logoColor=white)\r\n![TailwindCSS](https://img.shields.io/badge/tailwindcss-%2338bdf8.svg?style=for-the-badge\u0026logo=tailwind-css\u0026logoColor=white)\r\n\r\n## Getting started\r\n\r\nPlay around with the project w/ demo.py or view the demo web app locally.\r\n\r\n### Prerequisites\r\n\r\n- Python 3.10+ \r\n- pip\r\n- Node.js 18+\r\n- npm\r\n- PyTorch with CUDA\r\n- Git w/ LFS (if you want to run barebones NN)\r\n\r\n```bash\r\n# check versions\r\npython --version\r\nnode -v\r\npip --version\r\n```\r\n\r\n### Installation\r\n0. Setup \r\n```bash\r\npython3 -m venv venv\r\n# sudo apt install git-lfs (if you dont have it)\r\ngit lfs install\r\n```\r\n1. Clone the repo\r\n```bash\r\ngit clone https://github.com/sidsurakanti/mnist-classification.git\r\ncd /path/to/project/\r\ngit lfs pull # pull tracked mnist files for nn or download mnist and replace /dataset/ \r\n```\r\n2. Setup the model\r\n```bash\r\n# backend setup\r\npip install -r requirements.txt\r\nfastapi dev predict.py\r\n```\r\n3. Start up the website\r\n```bash\r\n# frontend setup\r\ncd frontend\r\nnpm install\r\nnpm run dev\r\n```\r\n\r\nThe app should now be live on http://localhost:3000!\r\n\r\n## Roadmap\r\n- [x] Build a neural net with only NumPy  \r\n- [x] Implement backpropagation \r\n- [X] Add softmax + cross-entropy   \r\n- [x] Visualize accuracy/loss  \r\n- [X] Rebuild using Pytorch\r\n- [X] Add GUI to draw digits and classify in real-time \r\n- [X] Improve digit preprocessing for the HTML canvas\r\n- [ ] Dockerize model\r\n- [X] Deploy online\r\n\r\n## Contributing\r\n\r\nPull requests are welcome! Feel free to open an issue or suggestion.  (be fr rn no one is pr'ing this)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsidsurakanti%2Fmnist-classification","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsidsurakanti%2Fmnist-classification","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsidsurakanti%2Fmnist-classification/lists"}