MCP
arXivarXiv
Preprint
Published: July 30, 2026
cs.CV

Deep learning-based hierarchical insect classification using camera trap imagery

Abstract
Declining insect populations make reliable biodiversity monitoring increasingly urgent, yet monitoring of insect biodiversity is hampered by a lack of standardised data and by costly and time-consuming manual identification by expert entomologists. Deep learning-based image classifiers, processing data from automated non-lethal camera traps, have the potential to transform and scale insect biodiversity monitoring. However, challenges remain in acquiring expert-annotated datasets, developing model architectures that generalise well across diverse taxonomic levels and training models on highly imbalanced data. Hierarchical data also benefits from designing models that default to higher-confidence, coarser-level predictions, when uncertain about finer taxonomic levels. In this paper we address these challenges with a deep learning-based hierarchical classification model. First, we present a manually curated, long-tailed dataset of around one million images of insects, extracted from 1,801 camera-trap video recordings and annotated with a five-level, 34-class hierarchy. Further, we adapt a hierarchical classification model architecture to a five-level variable-depth hierarchy, with class-balanced weighting. Our model improves on non-hierarchical classifiers by leveraging biological taxonomy to extract granularity-specific visual features and makes hierarchy-consistent predictions to the deepest taxonomic level that meets a confidence threshold (T = 0.6). Our model achieved a per-level accuracy of 80-99% on test data, across five levels of hierarchy. Furthermore ...
0
AI overview
Reviews
Citation graph
References · 32
Structured
This preview uses generator v1; v2 is available

Overview

Addressing the practical pain points of insect biodiversity monitoring, this paper builds a million-scale, manually annotated, long-tailed insect dataset extracted from camera trap videos and proposes a deep learning classification model adapted to a five-level hierarchical structure. After training with class-balanced weighting, long-tail classes achieve good classification performance even on highly imbalanced data.

Task Background and Existing Gaps in Insect Camera Trap Image Classification

Current arthropod population monitoring efforts face multiple real-world constraints: on one hand, monitoring data lack standardization in temporal and spatial dimensions; on the other, professionals with insect taxonomy expertise are in short supply. Traditional insect monitoring relies entirely on manual work, with the whole process being time-consuming and requiring entomology experts for species identification. Techniques such as DNA barcoding can provide definitive identification for species with high intraspecific and low interspecific variation, but such methods involve destructive sampling and cannot capture population abundance information for specific species.

Existing hierarchical classification models generally have adaptability gaps and require extensive targeted modification to fit the special constraints of insect monitoring scenarios, including variable-depth classification hierarchies, highly imbalanced long-tailed datasets, and low-quality field images with occlusion, poor shooting poses, and fluctuating lighting conditions. The field still lacks a general-purpose hierarchical classification solution that can directly adapt to custom hierarchies, accommodate imbalanced partially annotated data, and handle low-quality field images.

Among published hierarchical classification studies, a two-level genus-species hierarchical classification model built for fish samples, although performing better than a non-hierarchical flat classifier on partially occluded images, had a too-shallow hierarchy and did not introduce hierarchical constraints in the loss function; that study manually constructed balanced training, validation, and test subsets from highly imbalanced original museum specimens.

Building a Million-Scale, Manually Annotated, Hierarchical, Long-Tailed Insect Dataset

The raw material for the insect image dataset built in this study came from video data collected by FAIR-Device automatic camera traps. The device replaced the lethal trapping unit at the top of traditional Malaise insect traps and used motion triggering to record insects or other arthropods passing through. Raw video collection was carried out in two periods, July-August 2021 and August-September 2023, at 4 grassland sites in Lower Saxony, Germany, yielding 2,541 video records ranging in duration from a few seconds to several hours. For device design details and data samples, see the related work by Chiavassa et al. 2024.

The research team screened 1,801 valid records from the videos, extracted about one million insect images, and completed full manual verification and curation, forming a long-tailed distribution dataset for insect classification tasks. The dataset uses a five-level hierarchical annotation scheme, covering 34 hierarchical classes consistent with biological taxonomy.

Architecture Design of the Five-Level Hierarchical Deep Learning Insect Classification Model

The hierarchical insect classification model consists of a feature extraction backbone, 5 level-specific modules, and corresponding level-specific classification heads. The study uses a pretrained ResNet18 as the feature extraction backbone, which is computationally lightweight and stable across various vision tasks; backbone parameters are not frozen during training, and the full model is optimized end-to-end. Each level-specific module contains convolutional and fully connected layers that refine the backbone's output feature maps for the corresponding level, generating a level-specific feature embedding after pooling and flattening. You can use the figure below to fully trace the model's overall forward flow and the layout logic of the sub-structures inside the hierarchical blocks.

Fig. 1: The hierarchical classification model architecture includes a feature extraction backbone, level-specific convolutional refinement blocks, and fully connected layers; the fully connected layer outputs are fused with the finer-level outputs and classified after ReLU activation.

During inference, the model reuses the hierarchical state space matrix S introduced during training to score all legal classification states. First, the sigmoid outputs of all level classes are concatenated into a single prediction vector per sample; the score of each legal classification state is then computed via the corresponding row vector of the state space matrix operating on the prediction vector; finally, maximum a posteriori inference selects the legal hierarchical classification result with the highest probability.

Experimental Results on Classification Performance and Long-Tailed Data Adaptability

On the test set, the model's per-level covered-class accuracy has a minimum of 0.8174, with an overall range of 0.8174 to 0.9882. Matthews correlation coefficient (MCC) results show that from level L1 to L5, the class-distribution uniformity of the model's predictions gradually improves. The most imbalanced level, L2, still achieved an MCC of 0.7198, demonstrating the practical effectiveness of the class-balanced weighting strategy used during training. At the coarsest level L1, overall classification accuracy exceeds 98%, but this metric cannot reflect recognition deficiencies for rare classes: the rare class Arachnida had a recall of only 0.1682, and its samples were often misclassified as Insecta—a phenomenon that also validates the necessity of using MCC as the core evaluation metric.

Per-class image counts alone could explain less than one third of the variance in test F1 scores, with a corresponding R2R^2 of 0.3520. This result shows that when the class-balanced weighting strategy is applied during training, the model can achieve good classification performance on long-tail classes of a highly imbalanced dataset. You can use the scatter plot to directly observe the association trend between per-class image counts and test F1 scores.

Fig. 2: F1 score as a function of the number of images per class (log scale), showing the weak correlation between sample count and classification performance.

Factors Influencing Model Performance and Boundaries of Applicability

The study found that the total pixel count per class explains more of the F1 score variance than per-class image counts alone. This result indicates that when a class simultaneously has a low sample count and low per-sample resolution, the model's feature learning degrades noticeably.

Compared with other hierarchical models and flat models, this hierarchical classification architecture shows clear advantages in three dimensions: rare class classification, distinguishing visually similar classes, and dataset imbalance correction. However, overall model performance is still constrained by training data availability, with poor performance in two scenarios: classes with low resolution combined with low sample counts, and low-sample classes whose individual samples differ too much visually.

Deep learning applications for insect classification in biodiversity monitoring have long faced the high cost and time demands of acquiring expert annotations, while traditional flat classification models struggle to generalize well in large-scale class settings with large granularity differences and highly imbalanced training data. By building a hierarchical dataset extracted from automatic camera trap recordings, combined with a hierarchical image classification model with class-balanced weighting, this study achieves stable classification performance for both head and long-tail classes, effectively distinguishes visually similar classes, and leverages the hierarchical structure to maximize prediction confidence while minimizing the proportion of unclassified samples.

Rating
No ratings yet
Rate
Community rating
—
/ 5
No ratings yet
Rating
—
Soundness
—
Presentation
—
Contribution
—
Confidence
—
Discussion
Top
Newest
Questions
Replication
Author
No comments yet — be the first