{"id":49914663,"url":"https://github.com/canreader/mnistpy","last_synced_at":"2026-05-16T15:10:33.962Z","repository":{"id":194640242,"uuid":"438379272","full_name":"CanReader/MnistPY","owner":"CanReader","description":"This is my first AI model which uses tensorflo/keras","archived":false,"fork":false,"pushed_at":"2021-12-14T19:43:50.000Z","size":2,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2023-09-14T11:46:21.546Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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/CanReader.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}},"created_at":"2021-12-14T19:43:17.000Z","updated_at":"2023-09-14T11:46:26.356Z","dependencies_parsed_at":"2023-09-14T11:46:23.957Z","dependency_job_id":null,"html_url":"https://github.com/CanReader/MnistPY","commit_stats":null,"previous_names":["canreader/mnistpy"],"tags_count":null,"template":null,"template_full_name":null,"purl":"pkg:github/CanReader/MnistPY","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CanReader%2FMnistPY","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CanReader%2FMnistPY/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CanReader%2FMnistPY/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CanReader%2FMnistPY/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CanReader","download_url":"https://codeload.github.com/CanReader/MnistPY/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CanReader%2FMnistPY/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33107646,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-16T04:41:52.686Z","status":"ssl_error","status_checked_at":"2026-05-16T04:41:52.009Z","response_time":115,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2026-05-16T15:10:20.888Z","updated_at":"2026-05-16T15:10:33.956Z","avatar_url":"https://github.com/CanReader.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MNIST Digit Classifier\n\nA professional PyTorch implementation of a Convolutional Neural Network (CNN) for\nhandwritten digit classification on the [MNIST dataset](http://yann.lecun.com/exdb/mnist/).\n\n## Architecture\n\n| Layer | Output Shape | Parameters |\n|-------|-------------|------------|\n| Input | 1 x 28 x 28 | - |\n| Conv2d(1, 32, 3) + BN + ReLU + MaxPool | 32 x 14 x 14 | 416 |\n| Conv2d(32, 64, 3) + BN + MaxPool | 64 x 7 x 7 | 18,624 |\n| Flatten + Linear(3136, 128) + ReLU | 128 | 401,536 |\n| Dropout(0.25) + Linear(128, 10) | 10 | 1,290 |\n| **Total** | | **~422K** |\n\n## Features\n\n- **CNN architecture** with batch normalisation and dropout\n- **Data augmentation** (random rotation, translation) to improve generalisation\n- **Train / Validation / Test split** (54K / 6K / 10K)\n- **Early stopping** on validation loss with best-model checkpointing\n- **Learning rate scheduling** (StepLR)\n- **Full evaluation report** with per-class precision, recall, and F1\n- **Visualisations** — training curves, confusion matrix, sample predictions\n- **Single-image inference** script for custom images\n\n## Quick Start\n\n```bash\n# 1. Install dependencies\npip install -r requirements.txt\n\n# 2. Train and evaluate\npython main.py\n\n# 3. Predict on a custom image\npython predict.py path/to/digit.png\n```\n\n## CLI Options\n\n```\npython main.py [OPTIONS]\n\n  --epochs N       Number of training epochs (default: 15)\n  --batch-size N   Batch size (default: 128)\n  --lr F           Learning rate (default: 0.001)\n  --eval-only      Skip training, evaluate a saved checkpoint\n```\n\n## Project Structure\n\n```\nMnistPY/\n├── main.py           # Entry point — train, evaluate, visualise\n├── config.py         # All hyperparameters and paths\n├── model.py          # CNN architecture (MNISTNet)\n├── dataset.py        # Data loading, transforms, splits\n├── train.py          # Training loop with validation\n├── evaluate.py       # Metrics and classification report\n├── predict.py        # Single-image inference CLI\n├── visualize.py      # Plotting utilities\n├── requirements.txt  # Python dependencies\n└── outputs/          # Generated after training\n    ├── best_model.pth\n    ├── training_curves.png\n    ├── confusion_matrix.png\n    └── sample_predictions.png\n```\n\n## Expected Results\n\nWith default hyperparameters (~15 epochs), the model reaches **~99.2% test accuracy**.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcanreader%2Fmnistpy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcanreader%2Fmnistpy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcanreader%2Fmnistpy/lists"}