# SpeciesNet labels camera trap images with a detector then a classifier

> SpeciesNet is Google's Apache-2.0 model and tooling for classifying wildlife in motion triggered camera images, built as a two stage cascade of MegaDetector for finding animals and an EfficientNet V2 M classifier for naming the species. It suits conservation teams with large image backlogs and no labelling budget.

**google/cameratrapai** — AI models trained by Google to classify species in images from motion-triggered wildlife cameras.

- Repository: https://github.com/google/cameratrapai
- Stars: 579 · Forks: 70
- Language: Python
- License: Apache-2.0
- Published: 2026-10-22 · Updated: 2026-10-22 · Language: en
- Canonical page: https://hysenlabs.com/projects/google-cameratrapai

## Two models in series, and why the order matters

The repository hosts code for running a cascade of two AI models, an object detector that finds objects of interest in wildlife camera images, and an image classifier that classifies those objects to the species level. The detector is MegaDetector, which finds animals, humans and vehicles in camera trap images but does not classify animals to species level, and the classifier is SpeciesNet itself. This ordering is the core design decision and it is what makes the system workable on camera trap data, where a typical frame contains a small animal in a cluttered scene, often with a date stamp burned in and a wide range of lighting conditions. A classifier applied to the whole image would have to find the animal and name it at once. Splitting the job means the detector can be tuned for recall, and the classifier receives a crop, which is exactly the question the underlying paper examines. The paper is titled To crop or not to crop: Comparing whole-image and cropped classification on a large dataset of camera trap images, by Gadot, Istrate, Kim, Morris, Beery, Birch and Ahumada, published in IET Computer Vision in 2024.

## A classifier trained on more than 65 million images

The species classifier was trained at Google using a large dataset of camera trap images and an EfficientNet V2 M architecture, and it is designed to classify images into one of more than 2000 labels. Those labels are not only species. The set covers diverse animal species, higher level taxa such as mammalia or felidae, and non animal classes including blank and vehicle. The label hierarchy is a practical decision rather than a technical one, because a camera trap photograph is often genuinely ambiguous, a blurry shape might be best recorded as a higher level taxon than guessed at species level, and a blank frame or a human silhouette should not be forced into a species. The training data was geographically diverse, over 65M images, including curated images from the Wildlife Insights user community as well as images from publicly available repositories. The classifier is available on Kaggle as a model, and the whole approach is used for species recognition in the Wildlife Insights platform, which is the clearest signal of the operational context this was built for.

## Installing and running the ensemble from the command line

The package installs with pip:

```bash
pip install speciesnet
```

If you are on a Mac and hit an error during the step, the documentation says to add the --use-pep517 option. To confirm the install you can run the module script with the --help flag, which shows the help text for the main script you will use to run SpeciesNet.

The main script is run_model, and the documentation notes that you do not have to work at the command line at all if you would rather not, because there are tools that help you run SpeciesNet on your own computer or on cloud based systems, with Wildlife Insights and Animl named as cloud systems that support it and AddaxAI described as a popular graphical tool for running SpeciesNet on your computer. The run_model invocation takes a folder of images and a path for the output file, and the command automatically downloads and runs the detector and the classifier. Two operational details are worth noting. The command periodically logs output to the output file, and if it does not finish, for example because you cancel it or reboot, you can run the same command again and it picks up where it left off. The output is a JSON file, and the documentation has a section on its format and on converting it to other formats.

## The country filter is the difference between useful and noise

There is a failure mode the documentation calls out explicitly, and it is worth understanding before you read the output. In the example, the ensemble is not told what part of the world the images came from, so it may, for example, predict a kangaroo for an image from England. That is not a bug in the classifier so much as a missing prior, and the fix is a flag. You add --country GBR, using any ISO 3166-1 alpha-3 three-letter country code, and the ensemble filters predictions geographically. If your images are from the USA you can also give the two-letter state abbreviation with --admin1_region CA. The point to take away is that the geographic metadata your camera traps already carry, the country and the state or region, is worth wiring into the pipeline, because a classifier without it will confidently name species that do not live where the camera was pointed. The example in the documentation for the video and alternate detector path shows the same idea at finer granularity, with --country USA and --state CA. The repository also includes a data/ directory and a reverse_geocoder dependency, which suggests the pipeline can work from coordinates as well as names.

## Videos, other detectors, and the single command that covers it

If you want to run SpeciesNet on videos, or want to use other MegaDetector versions, the documentation points you to a different entry point, run_md_and_speciesnet, from the MegaDetector Python package. The install is two packages:

```bash
pip install megadetector
pip install speciesnet
python -m megadetector.detection.run_md_and_speciesnet
```

And with arguments, a folder of images, an output file, and the geographic flags:

```bash
python -m megadetector.detection.run_md_and_speciesnet "c:\your\image\folder" "c:\your\output\file.json" --country USA --state CA
```

The output of that script is in the MegaDetector output format rather than the run_model format, which is a detail that matters if you are writing a parser and picking one entry point over the other. The main run_model script can also run the three steps, detector, classifier and ensemble, separately, and the repository links to a page on running each component separately in advanced_topics.md. The dependency list explains the machinery behind that separation: yolov5 pinned to a narrow range for the detector, onnx2torch to bring the model into PyTorch, torch at 2.0 or newer, huggingface_hub and kagglehub for model weights, pandas and numpy for the data, reverse_geocoder for place names, and tqdm for progress. The package requires Python 3.9 or newer and below 3.15, with classifiers listed up to 3.14.

## Fine tuning, output inspection, and what the repository expects from you

The documentation has separate sections for output format, visualising SpeciesNet output, ensemble decision making and fine tuning SpeciesNet, and the repository layout reflects a project that expects real work from the user. There are model_cards/ directories and a notebooks/ directory, a test_data/ directory, an images/ directory, a conftest.py, a .pylintrc, a citation.cff, and separate markdown files for advanced topics, installing Python and the main documentation file. The presence of a citation file and a documented citation section is worth noting for anyone planning a paper or a report, since the project asks you to cite the underlying work. The section on ensemble decision making is the one to read if you care about how the two models are combined, since that is where the tuning knobs live. And the section on visualising output is the one to read before you trust a number, because a per prediction confidence value in isolation says little. The repository also hosts a data/ directory, which suggests the training or evaluation data, or at least a sample of it, is available for inspection.

## Where a self calculated camera trap label is the wrong tool

The honest limitation is that this is a classifier with a fixed label set and a fixed training distribution, and neither is under your control. The label set includes higher level taxa, so a result recorded as felidae is not wrong but it is not a species record, and a downstream analysis that assumes species level will need to handle that. The model is also trained on a specific kind of imagery, camera traps, and the training set is described as geographically diverse but not as covering every habitat, so a project working in one region with unusual species or unusual camera placement should expect a different error profile than the paper's. The other limitation is that this is inference only. The repository documents a fine tuning section, which tells you the project expects you to retrain when the label set does not match your needs, and retraining a model for a new taxon set is a much larger commitment than running inference. Finally, the cost of the model download and the compute to run it are real, and the project does not publish a per species accuracy table, so any accuracy claim in your own report has to come from your own evaluation against your own labelled data. A self calculated label is a starting point for a workflow, and if your project requires regulatory grade identification, a human verification pass over the classifier output is still part of the job.

## Conclusion

Adopt SpeciesNet if you have a large back catalogue of camera trap images that humans have not labelled and you need species level labels to drive a conservation workflow, especially if your images have geographic metadata you can pass as a country filter. Do not adopt it as a general object detector or as a replacement for a reviewed dataset in a regulatory context, since the classifier's label set includes higher level taxa and non animal classes and the project does not describe a per species accuracy claim. Before you rely on it, run the ensemble on a small folder of images you have labelled yourself and check the errors, and pass the country and admin1 region flags so the geographic filter is active.

## FAQ

### What is SpeciesNet and how does it work?

SpeciesNet is an ensemble of AI models for classifying wildlife in camera trap images. It runs a cascade of two models, the MegaDetector object detector that finds animals, humans and vehicles, and an image classifier that names those objects to the species level.

### How do I install and run SpeciesNet?

Install the package with `pip install speciesnet`, then run `python -m speciesnet.scripts.run_model --help` to confirm the install and the run_model script for the main workflow. The run_model command takes a folder of images and an output JSON path, and it automatically downloads and runs both the detector and the classifier.

### What labels can SpeciesNet classify an image into?

More than 2000 labels, covering diverse animal species, higher level taxa such as mammalia or felidae, and non animal classes including blank and vehicle. The classifier was trained at Google on a geographically diverse dataset of over 65M camera trap images using an EfficientNet V2 M architecture.

### Why should I pass a country when running SpeciesNet?

Without geographic information the ensemble may predict a species that does not live where the camera was pointed, such as a kangaroo for an image from England. You can add --country with an ISO 3166-1 alpha-3 code, and --admin1_region with a two-letter state abbreviation for US images.

### Can I run SpeciesNet on videos?

Yes. Install the megadetector package alongside speciesnet and use the run_md_and_speciesnet entry point, for example `python -m megadetector.detection.run_md_and_speciesnet "c:\your\image\folder" "c:\your\output\file.json" --country USA --state CA`. Its output is in the MegaDetector output format.

## Sources

- [google/cameratrapai on GitHub](https://github.com/google/cameratrapai)
- [Issues](https://github.com/google/cameratrapai/issues)
- [License: Apache-2.0](https://github.com/google/cameratrapai/blob/main/LICENSE)
- [README](https://github.com/google/cameratrapai/blob/main/README.md)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/google-cameratrapai
