← All projectsMaster's thesis · inovex · 03/2026 – 09/2026

Real-time species detection on embedded hardware

A compact detector that finds and names 225 mammal species on a binocular's small chip, trained partly on AI-generated images.

  • PyTorch
  • Ultralytics YOLO
  • Knowledge distillation
  • Generative AI
  • ONNX Runtime
  • MLflow
  • Docker

A binocular should recognise the animal you are looking at, offline and directly on the device. That needs a compact object detector for 225 mammal species that runs in real time on a battery-powered embedded processor (Qualcomm QCS605). Two things make this hard: the hardware cannot run large models, and for rare species there are only a few openly licensed photos. The thesis asks how to train a compact detector under these conditions. It compares knowledge distillation with direct fine-tuning and fills the gaps for under-represented species with AI-generated training images.

Illustration of a binocular looking at a binturong inside a green detection box; part of the animal dissolves into pixels.
Fig. 1The thesis in one picture. AI-generated illustration.

What I did

  • Built a training set from openly licensed photos (iNaturalist, GBIF, Wikimedia Commons and others), cleaned automatically with MegaDetector, a vision-language model and CLIP: 222,073 real photos after filtering.
  • Compared ten image-generator configurations, among them gpt-image-2, Gemini, FLUX.2 and Stable Diffusion 3.5, and generated 23,850 images for the rarest species.
  • Fine-tuned the large SpeciesNet model as a teacher and distilled it into compact YOLO detectors (YOLO26n, YOLOv5s), compared with direct training.
  • Set up an evaluation with a mixed test set (real and generated) and analysed the domain shift between the two.
  • Exported the models and measured their speed on embedded hardware, with a Raspberry Pi as a stand-in for the target chip.
  • Tracked all experiments with MLflow; the training environment runs in Docker.

Rare animals and a small chip

The first problem is data. Lions and red foxes have been photographed millions of times; the binturong, a shaggy tree-dweller from Southeast Asia, has not. At the start, 114 of the 225 classes had fewer than 100 openly licensed photos, and 30 had none. Even after combining five sources, the 50 rarest classes averaged about 67 usable photos each.

The second problem is compute. The quickest working solution is a pipeline of two existing networks: a detector finds “an animal” and a classifier names each crop. That works, but the classifier runs once per animal, so a herd of zebras costs more than a single fox. The question was whether one small detector can do both jobs if part of its training data is generated.

Which image generator?

Asked for a binturong, open-weight models running on our own GPU tended to draw something closer to a small bear, while the API models drew a binturong. To back that impression with numbers, ten generator configurations each produced the same 1,200 images, and the same YOLO26n detector was trained on each set and scored on real photos.

Three AI-generated binturongs: a bear-like animal from a local model, and two convincing binturongs on branches from two API models.
Fig. 2Asked for a binturong: a model running locally (left) and two API models. All three images are AI-generated.
Bar chart ranking ten generator configurations by detector mAP on real photos; the API models lead.
Fig. 3Detector accuracy (mAP on real photos) after training on 1,200 images from each generator. Every API model beat every local model.

Two observations carried over into the rest of the work. A higher price did not reliably buy better training images once the field was narrowed down. And the prompt matters as much as the model: cutting the prompt of two API models to 75 tokens cost each of them almost half of its accuracy.

Four AI-generated lions from four generators, each with the number of prompt words it could read, from 4,642 down to 20.
Fig. 4One prompt for a lion, cut to what each generator can read. All images are AI-generated.

How much generated data is too much?

The 225 classes were split into bands by how many real photos exist. Classes trained on 100 real and 100 generated images reached an mAP of 58.8 % on real photos, against 59.1 % for classes with 200 real images. The rarest classes, trained on generated images alone, reached 30.0 %: about half, but without generated images these classes would be missing from the model.

Bar chart: mAP on real photos per band; mixed real and generated data matches real-only data, generated-only reaches about half.
Fig. 5Generated images replaced half of a small training set at almost no cost, but not all of it.

A generated test set, on the other hand, is misleading. The classes that score 99 % on generated test images score 30 % on real photos. Every number in the thesis is therefore reported on real photos.

Paired bars per band comparing mAP on generated and on real test images; the generated scores are far higher.
Fig. 6Scores on generated test images are far too high.

One nano detector instead of two networks

On a Raspberry Pi, the YOLO26n detector with 2.7 million parameters answers in 423 ms and reaches an mAP of 52.9 %. It is about 83 times faster than the large two-network reference system and about 13 times faster than the detector-plus-classifier pipeline, at a cost of 7 percentage points of mAP. Knowledge distillation from the large system did not help here: the distilled model reached 47.9 %, the directly trained one 52.9 %, most likely because the labels came from the same models that acted as teacher.

Scatter plot of mAP against time per frame on a log scale; YOLO26n sits top left, 83 times faster than the fine-tuned ensemble.
Fig. 7Species mAP on real photos against time per frame on a Raspberry Pi 400 (CPU, FP32).

The obvious next step is 8-bit quantisation for the chip’s DSP, which the thesis did not measure.