Weakly supervised attention-based models using activation maps for citrus mite and insect pest classification

Edson R. Bollis, Helena Almeida Maia, Hélio Pedrini, Sandra Avila

TL;DR

Researchers have developed a new deep learning approach called Two-Weighted Activation Mapping (Two-WAM) that can identify and classify tiny citrus mites and insect pests using only image-level labels. By "zooming in" on automatically detected regions of interest, their model outperformed existing weakly supervised methods by over 16 percentage points on challenging field datasets.

What Problem Does This Paper Address?

In the world of industrial agriculture, citrus mites are a billionaire-dollar headache. These pests are often invisible to the naked eye, requiring magnifying glasses for manual inspection—a process that is slow, expensive, and prone to human error.

While deep learning offers a solution, it usually relies on supervised learning, which requires thousands of images with manually drawn "bounding boxes" around every tiny pest. Creating these labels is a bottleneck. Weakly Supervised Learning (WSL) aims to train models using only image-level labels (e.g., "this image contains a mite") without specifying where the mite is. However, standard WSL methods often fail when the objects are "tiny and noisy," as is the case with microscopic mites in field conditions.

Methods

The authors propose a two-stage framework called Attention-based Multiple Instance Learning Guided by Saliency Maps.

  1. Stage 1 (The Bag Model): A Convolutional Neural Network (CNN) is trained on full images. To help the model find tiny pests, the authors introduced Two-Weighted Activation Mapping (Two-WAM). Unlike standard methods like Grad-CAM that produce coarse heatmaps, Two-WAM uses two optimized weights per feature map to create a high-resolution "saliency map" that highlights even the smallest regions of interest (ROIs).
  2. Stage 2 (The Instance Model): The system uses the saliency maps from Stage 1 to automatically crop the most relevant patches (the "instances") from the original image. A second model then classifies these high-resolution crops.
  3. Weighted Evaluation: Finally, the model aggregates the predictions from all patches, giving more weight to the patches that the saliency map identified as most important.

Datasets

The study evaluated the model on two distinct benchmarks:

  • Citrus Pest Benchmark (CPB): 10,816 images captured in the field using mobile devices with 60x magnification. It contains six types of mites. This dataset is notoriously "noisy" due to lighting and blur.
  • Noiseless CPB (NCPB): A subset of CPB manually cleaned by the authors to remove low-quality images, used to study the impact of noise on model performance.
  • Insect Pest (IP102): A large-scale benchmark of 75,222 images covering 102 insect classes. Unlike CPB, these are mostly "salient" (large) insects collected from the internet.

Key Insights and Ideas

  • The "Tiny Object" Challenge: Standard activation maps (like Grad-CAM) often "overflow" the boundaries of tiny objects or miss them entirely in noisy backgrounds. Two-WAM's mathematical formulation allows it to learn more precise locations, which is the "aha moment" for microscopic pest detection.
  • Noise is a Double-Edged Sword: The researchers found that while noise (blur, lighting) hurts the detection of tiny mites, it can actually help the model recognize larger, salient insects by forcing the model to look at more robust features.
  • Location without Labels: The model successfully inferred bounding box locations for pests even though it was never shown a single human-drawn box during training. This proves that attention mechanisms can effectively bridge the gap between classification and localization.

Key Results

  • Superior Accuracy: On the Citrus Pest Benchmark, the proposed model achieved 92.4% accuracy and a 91.8% F1-score.
  • Outperforming the State-of-the-Art: The model surpassed established weakly supervised methods like WILDCAT and Attention-based Deep MIL by at least 16 percentage points in all citrus mite scenarios.
  • Efficiency: By using Two-WAM, the network can infer activation maps directly during the forward pass, making it more suitable for future deployment on restricted hardware like mobile phones used by farmers in the field.

Limitations and Future Work

While the model excels at finding tiny mites, it showed a slight performance dip (about 1%) on larger insects compared to the authors' previous non-attention-based work. This suggests that the high-precision focus of Two-WAM might be "too zoomed in" for large pests.

Future directions include: * Class-Specific Weights: Currently, Two-WAM is class-agnostic. Making the weights dependent on the specific pest category could further improve accuracy. * Multi-Class Expansion: Moving beyond binary "pest vs. no pest" detection to specifically identify different mite species in a single pass. * Mobile Deployment: The ultimate goal is to package this into a non-toy app that farmers can use with a simple magnifying attachment on their smartphones.

Summary updated

BibTeX
@article{bollis2022weakly,
  author = {Edson R. Bollis and Helena Almeida Maia and Hélio Pedrini and Sandra Avila},
  title = {{Weakly supervised attention-based models using activation maps for citrus mite and insect pest classification}},
  journal = {Comput. Electron. Agric.},
  year = {2022},
  doi = {10.1016/j.compag.2022.106839},
}
Figure