An Ecologist‐Friendly R Workflow for Expediting Species‐Level Classification of Camera Trap Images

L. Petroni,L. Natucci,A. Massolo
DOI: https://doi.org/10.1002/ece3.70544
IF: 3.167
2024-12-14
Ecology and Evolution
Abstract:Our manuscript presents a R workflow to streamline camera trap images classification at the species level, combining image augmentation and deep learning models in a user‐friendly environment. Tested on a dataset from Central Italy, the procedure achieved over 90% accuracy in classifying 17 target mammals, humans, and vehicles, starting from just 1000 images per category, significantly reducing classification time compared to manual methods. Camera trapping has become increasingly common in ecological studies, but is hindered by analyzing large datasets. Recently, artificial intelligence (deep learning models in particular) has emerged as a promising solution. However, applying deep learning for images processing is complex and often requires programming skills in Python, reducing its accessibility. Some authors addressed this issue with user‐friendly software, and a further progress was the transposition of deep learning to R, a statistical language frequently used by ecologists, enhancing flexibility and customization of deep learning models without advanced computer expertise. We aimed to develop a user‐friendly workflow based on R scripts to streamline the entire process, from selecting to classifying camera trap images. Our workflow integrates the MegaDetector object detector for labelling images and custom training of the state‐of‐the‐art YOLOv8 model, together with potential for offline image augmentation to manage imbalanced datasets. Inference results are stored in a database compatible with Timelapse for quality checking of model predictions. We tested our workflow on images collected within a project targeting medium and large mammals of Central Italy, and obtained an overall precision of 0.962, a recall of 0.945, and a mean average precision of 0.913 for a training set of only 1000 pictures per species. Furthermore, the custom model achieved 91.8% of correct species‐level classifications on a set of unclassified images, reaching 97.1% for those classified with > 90% confidence. YOLO, a fast and light deep learning architecture, enables application of the workflow even on resource‐limited machines, and integration with image augmentation makes it useful even during early stages of data collection. All R scripts and pretrained models are available to enable adaptation of the workflow to other contexts, plus further development.
ecology,evolutionary biology
What problem does this paper attempt to address?