Inspiration
Camera traps photograph thousands of animals, but for most species nobody can tell which individual is in each photo. Bears are especially hard: unlike zebras or leopards, they have no spots or stripes to match. If a model could re-identify individual bears from photos, researchers could track movement and estimate population size without capturing or collaring animals, and without experts spending hours matching photos by hand.
We started out wanting to build a re-ID system for Florida black bears. With one semester and no labeled black bear data, we turned to two open benchmarks instead: PolarBearVidID (13 zoo polar bears) and BrownBearHeads (109 wild brown bears from McNeil River, Alaska, photographed 2017–2022). Our question became:
What kind of data, and how much training, does it take to re-identify individual bears reliably across years?
How we built it
We compared three kinds of model:
| Model | What it is | Trained on these bears? |
|---|---|---|
| MegaDescriptor-L | General wildlife re-ID model | No |
| BearID | Brown bear face pipeline (detect, align, embed) | No: trained on other brown bears |
| PoseSwin | Swin-B + head keypoints (Rosenberg, Zhou et al., 2026) | Yes: McNeil River bears |
We also trained a small head on frozen MegaDescriptor features, to see how far light training gets.
Polar bears. MegaDetector cropped each bear, BearID's detector found the face, and each model embedded its view: MegaDescriptor the body, BearID the aligned face. We scored pairs of frames from different videos with verification AUROC:
$$\text{AUROC} = P\big(s(\text{same-bear pair}) > s(\text{different-bear pair})\big)$$
where $s$ is the similarity between embeddings. 0.5 is chance and 1.0 is perfect. The key design choice was scoring twice: once with every different-bear pair, and once with only pairs of bears from the same zoo, so the enclosure, camera and lighting couldn't give the answer away. Confidence intervals come from a paired bootstrap that resamples whole bears.
Brown bears. We used the paper's strict leave-one-year-out protocol: each query photo is matched against photos from the other years, and same-bear, same-day photos never count as matches. Before comparing anything, we checked our setup: our PoseSwin rank-1 matched the paper's published results to within 0.001.
What we found
- On polar bears, the body model's lead was mostly a zoo effect. With all pairs, MegaDescriptor beat BearID (AUROC 0.768 vs. 0.660). With same-zoo pairs only, they tied (0.622 vs. 0.618). Masking the background with SAM 2.1 and normalising colour did not remove the gap, so whatever separates the zoos sits on the bear itself.
- On brown bears, training on the population was what mattered. Across years, the two off-the-shelf models found the right bear about 1 time in 10 (rank-1 0.094 and 0.057). Our cheap trained head reached 0.225. PoseSwin, trained on these bears, reached 0.710.
- Training on the species wasn't enough. BearID knew brown bears and still did no better than the general-purpose MegaDescriptor. It also can't process profile photos at all, while PoseSwin scored about 0.7 at every head angle.
- How you split the data decides the score. Zero-shot MegaDescriptor scores 0.925 on a random split, but about 0.12 when test photos come from a different year. Our own trained head showed the same drop: 0.87 on its random validation split, 0.18–0.30 across years.
Challenges we faced
- Pivoting datasets mid-semester. We redesigned the experiment around what open data existed, which meant learning two very different datasets quickly.
- Making the comparison fair. Our first polar bear results made the body model look clearly better. It took several rounds of controls (same-zoo pairs, background masking, colour normalisation, greyscale) to show how much of that was the zoo.
- Slow tools. BearID's face pipeline runs on CPU, and running it on all 72,939 brown bear photos would have taken about 15 hours. We sampled 2 photos per bear per day and gave every model exactly the same queries.
- Getting PoseSwin to load. The released config didn't match the checkpoints. We rebuilt the backbone at the right width and confirmed our features matched the authors' with cosine similarity ≥ 0.9999.
- Small data. PolarBearVidID frames are 256×128 px, so faces are only about 45 px wide, and 13 bears make every bear-level interval wide.
What we learned
The biggest lesson was that evaluation design can matter more than model choice. A model can look accurate by recognizing the day, the zoo or the camera instead of the animal. We also learned that a model trained on a related population doesn't transfer automatically: for these bears, there was no substitute for training on the individuals themselves. And real research takes longer than a semester: every answer raised a new question.
What's next
- Find what lets MegaDescriptor tell zoos apart: camera image quality, or genuine resemblance between related bears housed together.
- Test whether PoseSwin struggles on bears from Brooks River and Knight Inlet (where BearID was trained) as much as BearID struggled on McNeil River bears.
- Test recognizing bears the model has never seen, which matters most for real field monitoring.
BearCast: "What is BearCast? Florida's black bears share more and more of the state with people. When a bear gets into garbage, raids a bird feeder, damages property, or threatens pets or people, someone calls the Florida Fish and Wildlife Conservation Commission (FWC). FWC has logged more than 100,000 bear-related calls over the years.
BearCast turns those records, together with maps of habitat, housing, roads and land cover, into an interactive map of Florida that answers three questions:
Where are bear conflicts most likely next month? A forecast, updated every month. Where have bears been, and where do they like to live? Recent reports, likely habitat, and the corridors bears use to travel between populations. Where could a bear go from here? An animation of simulated bears wandering for two weeks, using movement patterns learned from GPS-collared bears." (https://github.com/NadimSuj/bearcast#what-is-bearcast)
Built With
- fastapi
- jupyternotebook
- maplibre
- postgresql
- python
- react
- typescript