June 10, 2026 · 2 min read
How Does AI Pet Matching Work? The Real Pipeline Explained
AI pet matching works by detecting your pet's face in a photo, converting it into a numerical "fingerprint" with a deep vision model, and then searching a database of other pets' fingerprints for the closest one. PetMatch's production pipeline does this in three steps: YOLOv8 face cropping, DINOv2 embedding, and vector similarity search across 7,500+ pets.
This isn't a hypothetical — it's the actual system running behind PetMatch. Here's each step in plain English.
Step 1: Find the face (YOLOv8)
Raw pet photos are messy: backgrounds, leashes, laps, other pets. An object-detection model (YOLOv8) locates your pet's face and crops tightly around it before anything else happens.
This step matters more than it sounds. Before we added face cropping, matches were occasionally influenced by similar backgrounds — two pets photographed on beige carpets looked "more similar" than they should. Cropping to the face fixed that class of error and measurably improved match quality across the whole pool.
Step 2: Turn the face into numbers (DINOv2)
The cropped face goes into DINOv2, a self-supervised vision transformer from Meta AI research. DINOv2 outputs an embedding — hundreds of numbers that together encode what the face looks like: coat pattern, ear shape and set, muzzle length, eye spacing, color distribution.
The key property: two faces that look similar to a human produce embeddings that are close together mathematically. Nobody hand-codes "floppy ears = 0.7." The model learned visual similarity from enormous amounts of imagery, and it transfers remarkably well to dogs and cats.
Step 3: Search the pool (vector similarity)
Your pet's embedding is compared against every same-species pet in the pool using cosine similarity in a vector database (pgvector on Postgres). Closest vectors = closest faces. The top hit becomes your pet's twin, with a percentage score; the full top-20 list is one referral away.
Why results keep getting better
Two compounding effects:
- A bigger pool. Every new pet is a potential better twin for thousands of existing pets. At 7,500+ pets and growing, "even better twin" upgrades happen constantly.
- A better model. Each pipeline improvement (like the face-crop upgrade, model version dinov2-base-v2-crop) re-scores the entire pool.
What it can't do
Honest limits: it matches appearance, not personality or DNA. A 92% match doesn't mean shared ancestry — it means a human glancing at both photos would do a double take. It's also only as good as the photo; a blurry, half-turned face produces a vague fingerprint. See photo tips in the main guide.
Try it on your own pet
Reading about embeddings is one thing; watching a stranger's cat with your cat's exact face appear on screen is another. Upload a photo and see who's out there.
Ready to meet your pet's twin?
Upload one photo. Our AI searches thousands of pets and shows you the closest match — free.
Find my pet's twin