Petus Breed Classifier (convnextv2_tiny)

Dog breed classifier trained on Stanford Dogs (120 breeds) using convnextv2_tiny backbone with ArcFace angular margin loss and progressive resizing.

Model Details

Property Value
Backbone convnextv2_tiny
Loss ArcFace (s=30.0, m=0.3)
Parameters 28,323,200
Input Size 336px
Val Top-1 91.8%
Val Top-5 98.7%
Training 2-phase (frozen head โ†’ unfrozen backbone)
Progressive Resize 224 โ†’ 336px

Training Recipe (v3)

  1. Phase 1: Frozen backbone, train ArcFace head only (2 epochs)
  2. Phase 2: Unfreeze backbone with 1/100th LR, cosine annealing (48 epochs)
    • 3-epoch linear LR warmup after unfreeze
    • Progressive resize from 224โ†’336 mid-training
    • ArcFace angular margin loss (no MixUp/CutMix needed)
    • Early stopping with patience=10

Usage

import torch
from torchvision import transforms
from PIL import Image

# Load model
checkpoint = torch.load("convnextv2_tiny_best.pt", map_location="cpu")

# Preprocess
transform = transforms.Compose([
    transforms.Resize(384),  # 336 * 1.14
    transforms.CenterCrop(336),
    transforms.ToTensor(),
    transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]),
])

image = Image.open("dog.jpg").convert("RGB")
input_tensor = transform(image).unsqueeze(0)

# Inference
model.eval()
with torch.no_grad():
    logits = model(input_tensor)
    pred = logits.argmax(dim=1).item()
    confidence = logits.softmax(dim=1).max().item()

Breeds

120 dog breeds from the Stanford Dogs dataset (synsets from ImageNet).

Citation

@misc{petus-breed-ml,
  author = {199 Biotechnologies},
  title = {Petus Breed Classifier},
  year = {2026},
  url = {https://github.com/199-biotechnologies/petus-breed-ml}
}

License

Apache 2.0

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Evaluation results