SadikNawazAI/sadik-image-classification-multiverse
Viewer β’ Updated β’ 77
A ResNet18 image classifier fine-tuned on the SADIK Vision Multiverse Dataset, created by Sadik Nawaz (Age 11).
The model classifies images into 4 categories:
| ID | Class | Meaning |
|---|---|---|
| 0 | anime_digital_art |
Anime, manga & digital art |
| 1 | cyberpunk_tech |
Cyberpunk, neon cities, robots, cyborgs |
| 2 | game_assets_3d |
3D renders, low-poly game assets |
| 3 | photorealistic_portraits |
Real photo portraits |
Note: class order is alphabetical, matching
torchvision.datasets.ImageFolder.
| Metric | Score |
|---|---|
| Out-of-fold accuracy | 83.1% |
| 5-fold CV accuracy | 83.3% Β± 6.3% |
| Out-of-fold macro F1 | 77.8% |
| Class | Precision | Recall | F1 | Support |
|---|---|---|---|---|
| anime_digital_art | 0.73 | 0.73 | 0.73 | 11 |
| cyberpunk_tech | 0.71 | 0.83 | 0.77 | 24 |
| game_assets_3d | 0.75 | 0.55 | 0.63 | 11 |
| photorealistic_portraits | 1.00 | 0.97 | 0.98 | 31 |
The dataset has only 77 hand-cleaned images, so these numbers are noisy. The confusion matrix and training curves are in this repo.
import torch
from PIL import Image
from torchvision import transforms
from torchvision.models import resnet18
ckpt = torch.load("model.pt", map_location="cpu")
model = resnet18(weights=None)
model.fc = torch.nn.Linear(model.fc.in_features, len(ckpt["class_names"]))
model.load_state_dict(ckpt["state_dict"])
model.eval()
tf = transforms.Compose([
transforms.Resize(256),
transforms.CenterCrop(224),
transforms.ToTensor(),
transforms.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225]),
])
image = Image.open("your_image.jpg").convert("RGB")
with torch.no_grad():
probs = model(tf(image).unsqueeze(0)).softmax(1)[0]
for cls, p in sorted(zip(ckpt["class_names"], probs.tolist()), key=lambda x: -x[1]):
print(f"{cls:28s} {p:.1%}")
Or use the included CLI:
python predict.py path/to/image1.jpg path/to/image2.jpg
Reproduce with:
python train.py --model resnet18 --data-dir ./data --out-dir ./artifacts
cyberpunk_tech vs game_assets_3d), which causes most mistakes.Sadik Nawaz β 11-year-old AI developer from Pakistan π΅π°