Automatic moth detection from trap images for pest management

Weiguang Ding, Graham W. Taylor

TL;DR

This paper introduces a deep learning-based system for automatically detecting and counting moths in images from field traps, a crucial step in pest management. By leveraging convolutional neural networks (CNNs) and a novel evaluation metric, the system achieves high accuracy and is adaptable to different pest species with minimal effort, paving the way for real-time, automated pest monitoring.

What Problem Does This Paper Address?

Traditional pest management relies on manual analysis of images from insect traps to count pests. This process is labor-intensive, time-consuming, expensive, and prone to errors, hindering the ability to achieve real-time monitoring and cost-effective pest control. Existing automated methods often require extensive, species-specific engineering and struggle with the inherent variability and low image quality found in real-world trap images (e.g., varying illumination, insect movement, focus issues, and presence of other objects). This paper aims to bridge this gap by developing a robust, automated system that can accurately detect and count pests directly from these challenging field images.

Methods

The core of the proposed solution is a sliding window approach powered by convolutional neural networks (CNNs). Here's a breakdown of the key methods:

  • Image Preprocessing: To combat illumination variability, a "grey-world" color correction algorithm is applied to white-balance the images.
  • CNN-based Classification: A CNN, similar in architecture to LeNet-5, is trained to classify local image patches. This network consists of convolutional layers for feature extraction, max-pooling layers for downsampling and translational invariance, and fully connected layers for final classification.
  • Sliding Window Detection: The trained CNN is applied to densely sampled, overlapping patches across the entire image. Each patch is assigned a probability score indicating the likelihood of containing a moth.
  • Non-Maximum Suppression (NMS): To eliminate redundant overlapping detections, NMS is employed. This process retains only the most confident detections within a local neighborhood.
  • Thresholding: A final threshold is applied to the remaining detections to filter out low-confidence results, producing the final set of detected moths.
  • Novel Evaluation Metric: The authors propose an evaluation metric inspired by pedestrian detection literature, using an "intersection-over-minimum" (IOMin) heuristic for matching detections to ground truth, which is more robust to shape variations than the standard Jaccard index.

Datasets

  • Codling Moth Dataset: The primary dataset consists of 177 RGB images captured from pheromone traps deployed in real-world field conditions. These images were manually annotated by entomology technicians with bounding boxes around codling moths. The dataset was split into training (110 images), validation (27 images), and test (40 images) sets.
  • No specific benchmark datasets were introduced or used for comparison beyond the authors' own dataset.

Key Insights and Ideas

  • Species-Agnostic Engineering: A significant contribution is the development of a detection method that requires minimal pest-specific engineering. This means the same CNN architecture and pipeline can be adapted to detect other insect species with only a change in training data, making it highly scalable.
  • Robustness to Real-World Conditions: The system demonstrates effectiveness despite the challenging conditions of field-collected trap images, such as variable illumination and cluttered backgrounds, which often degrade the performance of traditional methods.
  • Importance of Data Augmentation: The study highlights the effectiveness of data augmentation techniques (translation, rotation, flipping) in improving the performance of the CNN, especially when training data is limited.
  • Trade-off between Object and Image Level Performance: The best performing model for object-level detection (21x21 input size) differed from the best for image-level detection (35x35 input size), suggesting that optimizing for different tasks might require different model configurations.

Key Results

  • High Accuracy: The proposed CNN-based method achieved strong performance on the codling moth dataset. For instance, the best performing ConvNet model achieved a precision-recall AUC of 0.931 and a log-average miss rate of 0.099 at the object level. At the image level, the sens-spec AUC reached 0.888.
  • Superior to Baseline: The CNN approach significantly outperformed a logistic regression baseline across various input sizes and metrics.
  • Effectiveness of Data Augmentation: Data augmentation improved performance, with combined rotational and translational augmentation yielding the best object-level results.
  • Resilience to Limited Data: The algorithm maintained reasonable performance even when 80% of the training data was removed, underscoring the benefits of data augmentation and the robustness of the CNN approach.
  • Qualitative Success: Visual examples show the system successfully detecting moths in complex scenes, with correct detections, misdetections, and false positives clearly visualized.

Limitations and Future Work

  • Occlusion: The paper acknowledges that occlusion by other moths or debris can increase detection difficulty. While some performance improvement was seen by filtering occluded ground truths, this remains a challenge.
  • Contextual Information: The authors note that for some false positives, the classifier's 21x21 input patch might be visually similar to actual moth patches. Incorporating more peripheral context could potentially improve detection.
  • Temporal Reasoning: The current method processes images independently. Future work could involve reasoning over image sequences to exploit temporal correspondence, potentially improving robustness to time-related factors like decay.
  • Deblurring: Blurry images are identified as a source of errors, suggesting that incorporating deblurring filters could be beneficial.
  • Multi-Pest Detection: Extending the system to detect and classify multiple types of insects is a natural and promising future direction.
  • Refining Detections: Future work could explore refining bounding box predictions to polygons or parameterized curves for more precise insect shape representation.

Summary updated

Abstract

Highlights • We propose a convolutional neural network-based automatic moth detection pipeline. • We describe a set of methods for preprocessing raw moth trap images. • Our method shows promising performance on a codling moth dataset from images collected in the field. • Our species-agnostic method can be easily adapted to different pests and/or environments. Abstract 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.
BibTeX
@inproceedings{ding2016automatic,
  author = {Weiguang Ding and Graham W. Taylor},
  title = {{Automatic moth detection from trap images for pest management}},
  booktitle = {Comput. Electron. Agric},
  year = {2016},
  url = {https://openreview.net/forum?id=GEFXXFaLLo},
}
Figure