CIFAR-10 Image Classifier (ResNet18 Fine-tuned)
Model klasifikasi gambar untuk 10 kelas dataset CIFAR-10, menggunakan transfer learning dari ResNet18 pretrained (ImageNet).
Kelas
airplane, automobile, bird, cat, deer, dog, frog, horse, ship, truck
Performa
- Test Accuracy: 81.67%
Cara Pakai
import torch
import torch.nn as nn
from torchvision.models import resnet18
from huggingface_hub import hf_hub_download
# Download file model
model_path = hf_hub_download(repo_id="jagadwp/cifar10-resnet18-cnn", filename="cnn_cifar10_resnet18.pth")
# Bangun ulang arsitektur
model = resnet18(weights=None)
model.fc = nn.Linear(model.fc.in_features, 10)
model.load_state_dict(torch.load(model_path, map_location="cpu"))
model.eval()
Dataset
CIFAR-10 (torchvision.datasets.CIFAR10)
Training
- Optimizer: Adam (lr=0.0005)
- Loss: CrossEntropyLoss
- Epochs: 5
- Framework: PyTorch