AMI insect detector

Class-agnostic Faster R-CNN that boxes every insect on a nocturnal light-trap screen image; the detection stage of the AMI data companion and the Antenna platform.

  • Object Detection
  • Faster R-CNN ResNet50-FPN
  • Faster R-CNN MobileNetV3-Large-FPN
  • closed vocabulary

3 assets

Format: PyTorch

Boxes every insect on a light-trap screen image, without naming it.

Intended use. The first stage of the AMI (Automated Monitoring of Insects) pipeline. It is used by the AMI data companion desktop app and by the Antenna web platform, on images from camera traps that photograph a UV-lit screen at night. The boxes are passed on to a moth/non-moth filter, then to a regional species classifier (see the AMI moth classifiers entry). The detector also works as a stand-alone, class-agnostic insect detector for other trap designs, but expect a domain gap.

Architecture and training

  • Architecture: torchvision Faster R-CNN with a ResNet50-FPN backbone (default). There is also a MobileNetV3-Large-FPN version for CPU use. One foreground class plus background, and up to 500 boxes per image.
  • Training data (2023 models):
    • The Segment Anything Model (SAM) cut about 4,000 insect crops from 300 trap images.
    • After manual review, 2,600 clean crops were pasted onto trap backgrounds, making 5,000 synthetic training images (Jain et al., 2024).
    • A comment in the code says “GBIF images and synthetic data”. The paper describes only the synthetic trap composites.
  • Legacy 2021 model: trained directly on annotated trap images.
  • Training code: RolnickLab/ami-ml (src/localization).

Inputs and outputs

  • Input: a full-resolution RGB trap image, converted with ToTensor only. Resizing is left to torchvision’s internal transform, which defaults to a shortest side of 800 and a longest side of 1333. That default comes from torchvision; the repository does not document it.
  • Output: integer pixel boxes [x1, y1, x2, y2], filtered at the model-specific threshold shown in the asset notes. The returned boxes contain neither a score nor a class label.
  • In the AMI API (trapdata/api/schemas.py), each detection is returned as bbox{x1,y1,x2,y2} with its downstream classifications attached.

The documented AMI box-list profile describes post_process_single at ami-data-companion revision 55d0787: a list of integer pixel corners. Scores and class labels are discarded after filtering. This profile is source-inspected; full checkpoint inference has not been probed. The downstream API wraps boxes in richer detection records.

Performance

Not reported in the source publication: the ECCV 2024 paper gives no detector mAP, precision or recall. It only reports that the MobileNetV3 variant runs about 6x faster on CPU with near-similar accuracy.

Limitations

  • Class-agnostic. Moths, beetles, flies, caddisflies and spiders are all just object. Identification needs the downstream classifiers.
  • Synthetic training data. Trained on composites built from about 300 trap images. Real scenes with dense clusters, overlapping insects, shadows or screen folds are not well covered, and no in-the-wild benchmark is published.
  • Domain. Built for nocturnal UV light-trap screens. The authors note that diurnal traps are harder.
  • Small insects. The default torchvision resize means very small insects on high-resolution images may be lost. Consider tiling.
  • Hosting. The weights live only on a Digital Research Alliance of Canada object store, not on Zenodo or Hugging Face, and the files are unpinned. Some legacy AMI files (for example Turing-UK) already return 404.

How to obtain the weights

Direct HTTPS download from the object store, with no authentication. The AUTH_… segment of the URL is required. The URLs are defined in trapdata/ml/models/localization.py and trapdata/settings.py of ami-data-companion, curated at commit 55d0787570f8c9d92c450f4fb65a58dd25cf6634. Installing trapdata downloads them automatically.

License: no separate license is stated for the weights. This entry records AGPL-3.0, the license of the AMI code that defines, trains and serves them (ami-data-companion, ami-ml, antenna). The AMI dataset is MIT (Zenodo 10.5281/zenodo.11358689).

Citation

@inproceedings{jain2024ami,
  title     = {Insect Identification in the Wild: The {AMI} Dataset},
  author    = {Jain, Aditya and Cunha, Fagner and Bunsen, Michael J. and Ca{\~n}as, Juan Sebasti{\'a}n and
               Pasi, L{\'e}onard and Pinoy, Nathan and Helsing, Flemming and Russo, JoAnne and
               Botham, Marc S. and Sabourin, Michael and Fr{\'e}chette, Jonathan and Anctil, Alexandre and
               Lopez, Yacksecari and Navarro, Eduardo and P{\'e}rez, Filonila and Zamora, Ana C. and
               Ramirez-Silva, Jose Alejandro and Gagnon, Jonathan and August, Tom A. and Bjerge, Kim and
               Gomez Segura, Alba and B{\'e}lisle, Marc and Basset, Yves and McFarland, Kent P. and
               Roy, David B. and H{\o}ye, Toke T. and Larriv{\'e}e, Maxim and Rolnick, David},
  booktitle = {Computer Vision -- ECCV 2024},
  series    = {Lecture Notes in Computer Science},
  volume    = {15095},
  pages     = {55--73},
  publisher = {Springer, Cham},
  year      = {2024},
  doi       = {10.1007/978-3-031-72913-3_4}
}

@article{roy2024standardized,
  title   = {Towards a standardized framework for {AI}-assisted, image-based monitoring of nocturnal insects},
  author  = {Roy, D. B. and Alison, J. and August, T. A. and B{\'e}lisle, M. and Bjerge, K. and Bowden, J. J. and
             Bunsen, M. J. and Cunha, F. and Geissmann, Q. and Goldmann, K. and Gomez-Segura, A. and Jain, A. and
             Huijbers, C. and Larriv{\'e}e, M. and Lawson, J. L. and Mann, H. M. and Mazerolle, M. J. and
             McFarland, K. P. and Pasi, L. and Peters, S. and Pinoy, N. and Rolnick, D. and Skinner, G. L. and
             Strickson, O. T. and Svenning, A. and Teagle, S. and H{\o}ye, T. T.},
  journal = {Philosophical Transactions of the Royal Society B},
  volume  = {379},
  number  = {1904},
  pages   = {20230108},
  year    = {2024},
  doi     = {10.1098/rstb.2023.0108}
}