Model Card for Indonesian Bird Classifier

This is a classifier model based on fine-tuned DinoV2 Model with custom classifier nn head

Model Details

Model Description

Usage

from transformers import AutoModelForImageClassification, AutoImageProcessor
import torch
from PIL import Image
import torch.nn.functional as F
from model import CustomDinoV2ClassifierWithReg # Import model.py from this repository

model_name = "kisenaa/Indonesian-bird-classifier"
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")

processor = AutoImageProcessor.from_pretrained(model_name, cache_dir="./cache", use_fast=True)
config = cast(Dinov2WithRegistersConfig, Dinov2WithRegistersConfig.from_pretrained(model_name, cache_dir="./cache"))
model = CustomDinoV2ClassifierWithReg.from_pretrained(
    model_name,
    config=config,
    num_classes=131, # Number of bird class
    hidden_dim=256, # Hidden dim classifier layer
    cache_dir="./cache"
)
model.eval()
model.to(device) # type: ignore

image = Image.open(r"./sample_Javan-Myna_Acridotheres-javanicus.jpg").convert("RGB")
inputs = processor(images=image, return_tensors="pt").to(device)

with torch.no_grad():
    outputs = model(**inputs)
    probs = F.softmax(outputs.logits, dim=-1)
    pred_id = int(torch.argmax(probs, dim=-1).item())
    confidence = probs[0][pred_id].item()

print(pred_id, confidence)

# Get Original Label and Class name from label_mapping.csv

Evaluation Result

based on custom dataset

Metric Value
eval_accuracy 0.884272997032641
eval_f1 0.8788399039140878

Citation

@misc{johannes_daniswara_pratama_2025,
    author       = { Johannes Daniswara Pratama },
    title        = { Indonesian-bird-classifier (Revision d3942f8) },
    year         = 2025,
    url          = { https://huggingface.co/kisenaa/Indonesian-bird-classifier },
    doi          = { 10.57967/hf/5737 },
    publisher    = { Hugging Face }
}
Downloads last month
146
Safetensors
Model size
87M params
Tensor type
F32
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for kisenaa/Indonesian-bird-classifier

Finetuned
(3)
this model

Dataset used to train kisenaa/Indonesian-bird-classifier

Space using kisenaa/Indonesian-bird-classifier 1