CoolFace
Modelpublic

open-noodle/pet-recognition-base

sourceHugging Faceapache-2.0updated 2mo agoView on Hugging Face
0likes
Model Card

pet-recognition-base

Individual pet re-identification embeddings (dogs and cats) — the "which pet is this" layer used by Gallery's pet recognition, on top of whole-animal crops from its pet detector.

A frozen [`facebook/dinov2-base`](https://huggingface.co/facebook/dinov2-base) backbone (86M parameters) plus a trained linear projection to 512 dimensions. The projection's L2-normalized output is the embedding; identity is compared with cosine similarity. Fine-tuning the backbone was tried and rejected — it overfits the training identities and forgets DINOv2's general features, while the frozen-backbone projection beats zeroshot on both species.

I/O contract

Inputinput, float32 [N, 3, 224, 224], RGB, ImageNet mean/std normalized
Outputembedding, float32 [N, 512], L2-normalized
Batchdynamic
Opset17

Crop the detected animal's bounding box, resize to 224x224, normalize with ImageNet statistics (mean [0.485, 0.456, 0.406], std [0.229, 0.224, 0.225]). Compare embeddings with cosine similarity (equivalently, dot product — the outputs are unit vectors).

Quality

Verification EER and identification Top-1 on held-out identities — individuals never seen in training — scored over the complete test splits:

Test setImagesIdentitiesEERTop-1AUC
Dogs — Dogs-World (whole animal)53830164690.0470.6120.988
Cats — Cat Individual Images (whole animal)25751020.0450.9160.991
Dogs — DogFaceNet (unseen dataset, aligned faces)836313930.0310.9430.994

Training data & licensing

The backbone is Apache-2.0. The projection was trained only on openly-licensed data:

  • Dogs-World (CC0) — whole-animal dog photos, identity from the per-image metadata sidecars; single-dog images only.
  • Cat Individual Images (CC BY) — whole-animal cat photos, one directory per cat.

DogFaceNet (CC BY) is used for evaluation only. No restrictively-licensed pet re-ID dataset (PetFace, AvitoTech, MegaDescriptor) was used for training or distillation, so this model is safe for commercial use.

Siblings

pet-recognition-small / pet-recognition-base / pet-recognition-large trade accuracy against cost; base is Gallery's default.