0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Train a Lightweight Pet-Breed Classifier with PyTorch + TIMM (Mobile-Friendly)

Posted at

Why lightweight models for pet commerce (UX/SEO tốc độ)

Dataset: cấu trúc thư mục, cân bằng lớp, split train/val

Model zoo timm + Augmentations (Albumentations)

Training loop (mixed precision), metrics (F1/macro)

Export ONNX + simple CPU benchmark

Gotchas: label leakage, imbalance, overfit lông/màu nền

Further reading + demo link (Hugging Face)

Opening snippet (Markdown)
Problem: Pet e-commerce needs fast, accurate breed recognition on low-spec devices.
Goal: <80ms CPU inference, >90% macro-F1 on 20–30 popular breeds.
Approach: timm backbone + strong aug + label smoothing + ONNX export.
model.eval()
dummy = torch.randn(1,3,224,224)
torch.onnx.export(model, dummy, "petbreed.onnx", input_names=["input"], output_names=["logits"], opset_version=17)

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?