[Paper Review] A machine learning pipeline for automated insect monitoring
This paper presents an open-source, end-to-end machine learning pipeline for automated moth monitoring using camera traps, integrating object detection, moth/non-moth classification, fine-grained species identification, and individual tracking. The system achieves 77.81% accuracy on a real-world moth trap test set using zero-shot transfer learning from GBIF and iNaturalist data, enabling scalable, expert-free insect monitoring across diverse global deployments.
Climate change and other anthropogenic factors have led to a catastrophic decline in insects, endangering both biodiversity and the ecosystem services on which human society depends. Data on insect abundance, however, remains woefully inadequate. Camera traps, conventionally used for monitoring terrestrial vertebrates, are now being modified for insects, especially moths. We describe a complete, open-source machine learning-based software pipeline for automated monitoring of moths via camera traps, including object detection, moth/non-moth classification, fine-grained identification of moth species, and tracking individuals. We believe that our tools, which are already in use across three continents, represent the future of massively scalable data collection in entomology.
Motivation & Objective
- Address the critical lack of scalable insect monitoring data amid the ongoing insect decline and biodiversity crisis.
- Overcome limitations of manual entomological surveys, which are slow, geographically imbalanced, and dependent on scarce expert labor.
- Develop a robust, hardware-agnostic, and user-friendly ML pipeline that minimizes manual labeling and supports global deployment.
- Enable fine-grained species-level identification of moths from camera trap images using transfer learning from diverse public datasets.
- Support long-term ecological monitoring by tracking individual moths across frames to count abundance per species.
Proposed method
- Utilize zero-shot transfer learning by training on high-quality, publicly available images from GBIF and iNaturalist, rather than relying on costly manual labeling of trap images.
- Implement a modular pipeline: first, object detection localizes insects using classical image processing and deep learning; second, a binary classifier distinguishes moths from non-moths.
- Apply a fine-grained species classifier based on ResNet-50 architecture with data augmentation to handle domain shift between training (GBIF) and deployment (trap) data.
- Use a cost-based tracking algorithm that combines IoU, size ratio, spatial distance, and feature similarity from the species classifier to match moths across consecutive frames.
- Employ strong data augmentation including random crop, horizontal flip, RandAugment, and mixed-resolution simulation to improve robustness to low-resolution trap images.
- Develop the AMI Data Companion and AMI Web Platform for user-friendly, scalable processing with GUI and CLI support, enabling collaboration and fault-tolerant batch processing.

Experimental results
Research questions
- RQ1Can a machine learning pipeline achieve high accuracy in moth species identification without requiring extensive manual labeling of field-trap images?
- RQ2How effective is zero-shot transfer learning from public biodiversity datasets (e.g., GBIF, iNaturalist) for classifying moths in real-world camera trap deployments?
- RQ3To what extent can a modular ML pipeline handle variability in camera hardware, lighting, and geographic regions while maintaining performance?
- RQ4How accurately can individual moths be tracked across frames in intermittent camera trap sequences with large inter-frame movements?
- RQ5Can the pipeline be deployed at scale across multiple continents with minimal expert intervention, supporting global insect monitoring efforts?
Key findings
- The fine-grained species classifier achieved 86.14% accuracy on a held-out test set from the GBIF dataset, demonstrating strong generalization from transfer learning.
- On a small, expert-annotated test set from actual moth trap images, the model achieved 77.81% accuracy, indicating effective adaptation to real-world deployment conditions.
- The use of strong data augmentation, including mixed-resolution simulation, significantly improved model robustness to the lower resolution of camera trap images.
- The tracking module successfully matched moths across frames using a cost function combining spatial, size, and feature-space similarity, enabling individual counting despite large inter-frame movements.
- The pipeline has been deployed and is actively used across Canada, the USA, the UK, Denmark, and Panama, demonstrating real-world scalability and cross-geographic applicability.
- The AMI Data Companion and AMI Web Platform enable non-expert ecologists to process data, manage models, and collaborate globally, reducing barriers to entry for ML-based entomology.

Better researchstarts right now
From reading papers to final review, dramatically reduce your research time.
No credit card · Free plan available
This review was created by AI and reviewed by human editors.