{"id":29790123,"url":"https://github.com/holedev/improve-cifar10","last_synced_at":"2025-07-27T23:05:19.670Z","repository":{"id":304942011,"uuid":"1019937573","full_name":"holedev/improve-cifar10","owner":"holedev","description":"A PyTorch implementation of image classification on the CIFAR-10 dataset using a custom CNN.","archived":false,"fork":false,"pushed_at":"2025-07-16T09:42:45.000Z","size":27571,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-17T09:43:28.564Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/holedev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-07-15T05:30:00.000Z","updated_at":"2025-07-16T06:48:41.000Z","dependencies_parsed_at":"2025-07-17T14:37:14.840Z","dependency_job_id":null,"html_url":"https://github.com/holedev/improve-cifar10","commit_stats":null,"previous_names":["holedev/improve-cifar10"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/holedev/improve-cifar10","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/holedev%2Fimprove-cifar10","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/holedev%2Fimprove-cifar10/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/holedev%2Fimprove-cifar10/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/holedev%2Fimprove-cifar10/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/holedev","download_url":"https://codeload.github.com/holedev/improve-cifar10/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/holedev%2Fimprove-cifar10/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267437083,"owners_count":24086919,"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","status":"online","status_checked_at":"2025-07-27T02:00:11.917Z","response_time":82,"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":[],"created_at":"2025-07-27T23:05:11.924Z","updated_at":"2025-07-27T23:05:19.640Z","avatar_url":"https://github.com/holedev.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CIFAR-10 Image Classification with HeheNet\n\nA PyTorch implementation of image classification on the CIFAR-10 dataset using a custom CNN called **HeheNet**. The model achieves **90.16% accuracy** after 100 epochs of training.\n\nThis project has trained on **NVIDIA GEFORCE RTX 3050 LAPTOP GPU**.\n\n## 📊 Model Performance\n\n| Epochs | Accuracy |\n|--------|----------|\n| 20     | 84.16%   |\n| 50     | 88.59%   |\n| 100    | 90.16%   |\n\n## 🏗️ Model Architecture\n\nHeheNet is a custom CNN with the following architecture:\n- **Conv Layer 1**: 3→32 channels, 3x3 kernel, padding=1, BatchNorm, ReLU\n- **Conv Layer 2**: 32→64 channels, 3x3 kernel, padding=1, BatchNorm, ReLU, MaxPool\n- **Conv Layer 3**: 64→128 channels, 3x3 kernel, padding=1, BatchNorm, ReLU, MaxPool  \n- **Conv Layer 4**: 128→256 channels, 3x3 kernel, padding=1, BatchNorm, ReLU, MaxPool\n- **Fully Connected 1**: 256×4×4 → 512, ReLU, Dropout(0.5)\n- **Fully Connected 2**: 512 → 10 (output classes)\n\n**Data Augmentation**: Random crop with padding, random horizontal flip, and normalization based on https://github.com/kuangliu/pytorch-cifar/issues/19 .\n\n## ☁️ Google Colab Setup\n\n### One-Click Button (Recommended)\n\n[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/holedev/improve-cifar10/blob/main/Improve_Cifar10_with_HeheNet.ipynb)\n\n### Upload Project to Colab\nUpload the entire project folder to your Colab environment or mount Google Drive:\n\n```python\nfrom google.colab import drive\ndrive.mount('/content/drive')\n%cd /content/drive/MyDrive/your-colab-path/improve-cifar10\n```\n\n## 🚀 Setup Local \n\n### 1. Clone and Navigate\n```bash\ngit clone git@github.com:holedev/improve-cifar10.git\ncd improve-cifar10\n```\n\n### 2. Create Virtual Environment (Recommended)\n```bash\npython -m venv .venv\nsource .venv/bin/activate  # On Windows: .venv\\Scripts\\activate\n```\n\n### 3. Install Dependencies\n```bash\npip install -r requirements.txt\n```\n\n## 🏋️ Training + Testing\n\n### Configuration\nModify [`src/config.py`](src/config.py) to change training parameters:\n\n```python\nnum_epochs = 20 \nresult_path = f\"./src/result/HeheNet_{num_epochs}epochs.pth\"\n```\n\n### Basic Training\n```bash\npython ./src/train.py\n```\n\n### Training with Custom Model Path\n```bash\npython ./src/train.py --data-path ./path/custom_model.pth\n```\n\n### Basic Testing\n```bash\npython ./src/test.py\n```\n\n### Testing with Custom Model Path (prevtrain model)\n```bash\npython ./src/test.py --data-path ./src/prevtrain/HeheNet_100epochs.pth\n```\n\n### Sample test output:\n```\n==================================================\nModel loaded from: ./src/result/HeheNet_100epochs.pth\n==================================================\n=== Accuracy for class: plane is 90.7 % ===\n=== Accuracy for class: car   is 94.8 % ===\n=== Accuracy for class: bird  is 84.1 % ===\n=== Accuracy for class: cat   is 82.8 % ===\n=== Accuracy for class: deer  is 91.7 % ===\n=== Accuracy for class: dog   is 81.1 % ===\n=== Accuracy for class: frog  is 95.3 % ===\n=== Accuracy for class: horse is 91.9 % ===\n=== Accuracy for class: ship  is 94.6 % ===\n=== Accuracy for class: truck is 94.6 % ===\n==================================================\n🎯 Overall accuracy on 10000 test images: 90.16 %\n==================================================\n```\n\n## 📁 Project Structure\n\n```\nimprove-cifar10/\n├── README.md               # Project documentation\n├── requirements.txt        # Python dependencies\n├── .gitignore              # Git ignore rules\n├── data/                   # CIFAR-10 dataset (auto-downloaded)\n│   └── cifar-10-batches-py/\n└── src/                    # Source code directory\n    ├── config.py           # Training configuration\n    ├── model.py            # HeheNet architecture definition\n    ├── train.py            # Training script with CLI args\n    ├── test.py             # Evaluation script with CLI args\n    ├── utils.py            # Helper functions and class names\n    └── result/             # Trained model weights\n    └── prevtrain/          # Previous trained models\n        └── HeheNet_100epochs.pth \n        └── HeheNet_50epochs.pth  \n        └── HeheNet_20epochs.pth\n```\n\n## Screenshots\n### Google Colab Training and Testing\n![Google Colab Train](images/colab_train.png)\n\n![Google Colab Test](images/colab_test.png)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fholedev%2Fimprove-cifar10","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fholedev%2Fimprove-cifar10","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fholedev%2Fimprove-cifar10/lists"}