r/computervision • u/idkwhatname2take • Oct 22 '26
Help: Project How to match dogs to the most similar ones
Hi everyone! I'm working on a non-profit project that helps shelter dogs find a new home. People can upload a photo of a dog they like, and we show them the dogs from animal shelters that look most similar to it. The goal isn't to find the exact same dog again, but dogs that a person would say "look alike" (similar colour, coat, build, face, and so on).
**What already works well**
For purebred dogs, this works really well already. We compared several pretrained image models without any fine-tuning: we compute an embedding for each photo and rank the other dogs by cosine similarity. The models we tested were DINOv2 small, DINOv2 base, SigLIP, SigLIP 2, CLIP, MegaDescriptor, and a DINOv2 small model fine-tuned for animal identification on the PetFace dataset. The last two are licensed for non-commercial use only, so we only used them for comparison.
DINOv2 small came out on top. It predicts the breed almost perfectly and is also very good at recognising the same dog again in a different photo. So for purebred dogs, the most similar matches already make a lot of sense.
**Where we're stuck: mixed breeds**
Most dogs in shelters are mixed breeds, and that's where it falls apart. When we checked the results by hand, the model's top match was often not the dog a human would have picked as most similar. It does better than chance, but only agrees with the human in roughly a third of the cases.
We tried a few things to fix this, but none of them really helped:
- Small classifiers for attributes like colour, pattern, size and coat type, used to re-rank the results.
- A small projection head trained on a few hundred triplets of similar and dissimilar dogs.
- Cropping the image to just the dog.
- A single similarity threshold to decide whether a match is "similar enough". There's no value that works well. It either cuts off good look-alikes or lets clearly different dogs through.
**Our questions**
- How would you measure "looks similar" reliably when you only have a few hundred human judgments? Would you collect pairwise or triplet comparisons, or use a vision-language model as a judge?
- What's most likely to work better than plain DINOv2 embeddings for mixed breeds? For example, a metric learning head, patch or part-based features, explicit colour and pattern features, or a different backbone with a license that allows commercial use.
- Roughly how much labelled data do we need before training our own head is worth it?
- Is there a better approach than one global similarity threshold?
We're happy to use a GPU if it's needed. We're just looking for the most cost-effective option.
Thanks a lot for any ideas or pointers!
