Source-linked AI summary
Automatic Moth Detection from Trap Images for Pest Management
Weiguang Ding, Graham Taylor
TL;DR
Manual pest counting in trap images is slow, costly, and vulnerable to field-image variability, motivating automated monitoring. The paper uses a ConvNet sliding-window pipeline with non-maximum suppression and thresholding, achieving effective qualitative and quantitative performance on a codling moth dataset while requiring little pest-specific engineering.
Problem
Manual trap-image analysis is labour intensive, slow, expensive, and error-prone, while low quality and field variability complicate automated pest detection.
Method
A convolutional neural network classifies densely sampled image patches, which are filtered by non-maximum suppression and probability thresholding to produce detections.
Results
Qualitative and quantitative experiments demonstrate the proposed method’s effectiveness on a codling moth dataset.
Takeaways & Limitations
The data-driven approach can adapt to new pest species and environments without much manual effort when relevant training data are available.
Takeaways & Limitations
Time-related changes in wing pose, occlusion, illumination, decay, and texture cause errors that may require temporal image sequences for improvement.
Abstract
from arXiv · showhide
Monitoring the number of insect pests is a crucial component in pheromone-based pest management systems. In this paper, we propose an automatic detection pipeline based on deep learning for identifying and counting pests in images taken inside field traps. Applied to a commercial codling moth dataset, our method shows promising performance both qualitatively and quantitatively. Compared to previous attempts at pest detection, our approach uses no pest-specific engineering which enables it to adapt to other species and environments with minimal human effort. It is amenable to implementation on parallel hardware and therefore capable of deployment in settings where real-time performance is required.
1. Introduction
Trap-image pest monitoring is difficult because manual counting is slow and costly, while image quality and field variability undermine engineered detectors. The paper develops a ConvNet-based detection approach intended to automate pest recognition and counting with minimal pest-specific engineering.
- Manual analysis of trap images is labour intensive, slow, expensive, and sometimes error-prone, preventing real-time and cost-effective monitoring.
- Earlier insect detection methods rely heavily on engineered features and are limited to specific species and environments.
- Trap images pose challenges from low image quality and variability in illumination, motion, focus, occlusion, decay, and non-pest insects.
- The proposed method applies convolutional neural networks within a sliding-window detection pipeline to classify local image patches.
- The paper contributes a ConvNet-based detector designed to be accurate, fast, extendable to other pest species, and minimally dependent on preprocessing.
2. Data collection
The dataset consists of remotely transmitted trap images collected in commercial production environments and divided into training, validation, and test sets. Images are white-balanced before detection to reduce illumination variability while retaining colour information.
- RGB trap images are captured daily at 640×480 resolution and transmitted to a remote server from pheromone traps installed at multiple locations.
- Collected images are randomly split into training, validation, and test sets with approximately matched dataset statistics.
- Colour correction uses a grey-world method because production environments produce illumination differences across acquisition times.
- White balancing equalizes average channel illumination while preserving rich colour information used by downstream detection.
3. Detection pipeline
The pipeline classifies densely sampled image patches with a ConvNet, then suppresses overlapping detections and thresholds the remaining confidence scores. The network combines convolution, pooling, and fully connected layers to produce patch-level pest probabilities.
- Detection pipeline: Each image patch receives a probability p ∈[0, 1] indicating whether it contains a codling moth.Patches are densely and regularly sampled, so neighboring windows largely overlap.
- Detection pipeline: Non-maximum suppression retains locally maximal windows before thresholding produces the final detection boxes and confidence scores.The suppression step removes overlapping boxes with lower probabilities.
- Convolutional neural networks: The ConvNet contains 2 convolutional layers, 2 max-pooling layers, and 2 fully connected layers.Its input patches are normalized dimension-wise to zero mean and unit variance.
- Convolutional layers: Convolutional layers transform feature maps using local filterbanks and nonlinearities while preserving spatial relationships across increasingly high-level representations.The convolutional weights are locally connected and tied across locations, with RELU nonlinearities.
- Max-pooling layers: Max-pooling preserves local maxima, reducing free parameters and introducing a small amount of translational invariance.Each convolutional layer is followed by a max-pooling layer.
- Fully connected layers: The first fully connected layer vectorizes the final feature maps, while the second is parameterized like a linear classifier.The hidden fully connected layer uses RELUs and the output layer uses softmax.
4. Experiments and evaluation
The experiments evaluate a ConvNet classifier trained on generated patches using minibatch SGD with momentum. Model parameters are selected according to the best observed validation-set accuracy.
- Classifier training: The classifier is trained on generated patches of different sizes.The patch sizes are detailed in Section 4.2.
- Classifier training: Minibatch stochastic gradient descent uses a learning rate of 0.002, minibatch size 256, and momentum coefficient 0.9.Gradients are estimated by back-propagation.
- Classifier training: The validation set monitors training and selects hyperparameters, with reported performance based on the model achieving the best observed validation accuracy.ConvNet filters and fully connected matrices are initialized from a size-dependent uniform random distribution.
4.2. Training data extraction
Training patches are extracted from manually labelled moth boxes and deliberately selected negative regions, then refined through hard-negative bootstrapping.
- 4.2. Training data extraction: Local patches are extracted efficiently as memory views using pointer arithmetic instead of storing every patch.This supports training from high-resolution source images without materializing all extracted patches.
- 4.2.1. Positive patches: Positive patches are square regions centered on manually labelled rectangular bounding boxes, with the original aspect ratio ignored for ConvNet inputs.Each positive patch represents one codling moth.
- 4.2.1. Positive patches: Augmented copies of a single positive example retain the same positive label after translation, rotation, and flipping.The figure illustrates label-preserving geometric transformations.
- 4.2.2. Negative patches: Negative patches are selected from moth-free images using Canny edges to target textured regions rather than mostly uninformative background.The number of negative patches is set to roughly match the number of labelled moths.
- 4.2.2. Negative patches: Bootstrapping adds the 6000 highest-probability false-positive patches from the first training round to the initial negatives for second-stage training.This procedure is intended to make the classifier more discriminative.
4.3. Data augmentation
Because the training set contains far fewer patches than typical small-scale image-classification datasets, the authors use augmentation to enlarge it and add geometric invariance.
- 4.3. Data augmentation: Data augmentation increases the number of training images when the available training-patch count is much smaller than roughly 50,000-example datasets.It also incorporates invariance to basic geometric transformations into the classifier.
4.4. Detection
Detection uses a sliding-window stride that trades localization quality against computation.
- 4.4. Detection: A smaller stride provides denser patch coverage and better moth localization but requires more computation.The supplied passage begins the chosen stride value but does not include its complete value.
- 4.4. Detection: The detection-stage stride is the distance between adjacent sliding windows.The supplied text identifies the stride definition but truncates the selected setting.
4.5. Evaluation protocol
The evaluation protocol matches detections to labelled moth boxes using IOMin, then measures performance at both object and image levels with metrics that expose detection–false-positive trade-offs.
- 4.5.1. Matching detections with ground truth: A proposed box is matched to a ground-truth box when their intersection-over-minimum exceeds 0.5; unmatched proposals are false positives.When multiple detections qualify, the highest-probability detection is selected.
- 4.5.1. Matching detections with ground truth: IOMin replaces intersection-over-union because rectangular ground-truth boxes and square classifier patches can have shape mismatches.The supplied passage explains that IOU works better when the ground-truth rectangle is nearly square.
- 4.5.2. Object level evaluation: Object-level evaluation focuses on individual moths and reports miss rate, FPPI, precision, recall, and Fβ score.These measures are based on correct detections, misdetections, and false positives.
- 4.5.2. Object level evaluation: The Fβ score weights precision and recall at one operating point, with β = 2 because detecting all moths is prioritized over reducing false positives.The larger the Fβ score, the better the performance.
- 4.5.2. Object level evaluation: Scalar object-level summaries are log-average miss rate over FPPI [1, 10] and area under the precision-recall curve.These summarize miss-rate-versus-FPPI and precision-versus-recall plots.
- 4.5.3. Image level evaluation: Image-level evaluation determines whether each image contains moths, supporting semi-automatic review that proposes moth images and ignores no-moth images.Image-level curves include sensitivity versus specificity and precision versus recall, with AUC used as scalar summaries.
5. Results
The detector was evaluated qualitatively and quantitatively on codling moth trap images, including comparisons across classifiers, input sizes, augmentation settings, and occlusion conditions.
- Qualitative results: Figure 7 visualizes correct detections, misdetections, and false positives for the best object-level and image-level classifiers.Green boxes mark annotations, magenta boxes proposals, and blue, red, and yellow boxes indicate misdetections, false positives, and correct detections, respectively.
- Classifier comparison: The 21×21 ConvNet performed best at the object level, while the 35×35 ConvNet performed best at the image level.Figure 8 compares these best-performing ConvNets with logistic regression at both evaluation levels.
- Classifier comparison: The ConvNet achieved nearly perfect results at the image level in the reported performance curves.Precision sometimes increased with recall because lowering the threshold could add only true detections.
- Data augmentation: Both translational and rotational augmentation improved performance over no augmentation, but combined augmentation improved object-level performance while one augmentation type sufficed at the image level.The augmentation experiments used the 21×21 ConvNet and compared four augmentation settings.
- Training-data reduction: The algorithm maintained reasonable performance after 80% of the training data were removed.The authors interpret this result as evidence for the effectiveness of data augmentation.
- Occlusion analysis: Removing occluded ground truths and heavily overlapping detections increased precision-recall AUC from 0.931 to 0.934 and decreased log-average miss rate from 0.099 to 0.0916.The reported improvement was at the object level and was described as slight.
- Individual detection results: Detection outcomes varied across wing poses, occlusion, decay, illumination, background texture, and blur, while some false positives resembled moth patches within the classifier window.The authors suggest that peripheral context could improve detection performance.
6. Discussion
The discussion emphasizes that the method depends more on training data than pest-specific expertise, while identifying temporal, visual, and labeling-related directions for improvement.
- Data-driven design: The approach uses no codling-moth-specific knowledge and can adapt to new pest species and environments when relevant data are available.The network learns from positive and negative training examples rather than manually designed pest knowledge.
- Error sources and extensions: Time-related variation in wing pose, occlusion, illumination, decay, and texture can contribute to detection errors.The authors propose using temporal image sequences to exploit correspondence across observations.
- Error sources and extensions: Blurry images could potentially be addressed with deblurring preprocessing, while false positives from pheromone lures, flies, and leaves could motivate additional object detectors.The latter extension would require a dataset with richer labeled information.
- Future extensions: The paper identifies deeper ConvNets and detection of multiple insect types as natural future extensions.These directions are presented as extensions of this preliminary automatic pest-detection attempt.
- Future extensions: Detection localization could potentially be refined using rectangular bounding boxes, polygons, or parameterized curves representing insect shapes.This would extend beyond the current patch-based localization representation.
7. Conclusions
The paper presents an automatic sliding-window ConvNet pipeline for pest monitoring from trap images and reports qualitative and quantitative effectiveness on a codling moth dataset.
- Conclusions: The pipeline classifies local image patches with a ConvNet, then applies non-maximum suppression and thresholding to produce final detections.The method is evaluated through qualitative and quantitative experiments and accompanied by error analysis and proposed future directions.