Detection of small targets in cucumber disease images through global information perception and feature fusion

Xuewei Wang, Jun LiuFrontiers in Sustainable Food Systems 2024 · DOI

TL;DR

Researchers have developed CucumberDet, a specialized deep-learning model designed to spot tiny disease lesions on cucumber leaves in messy, real-world environments. By swapping standard convolutional backbones for a Swin Transformer and adding custom feature-fusion modules, the team achieved a 92.5% mean Average Precision (mAP), significantly outperforming general-purpose detectors like YOLOv8 and RetinaNet.

What Problem Does This Paper Address?

Automated crop monitoring is the "holy grail" of precision agriculture, but it’s surprisingly difficult to do well. Cucumber diseases like Anthracnose or Downy Mildew often start as tiny, faint spots that are easily missed by standard computer vision models.

The authors identify three main hurdles:

  1. Environmental Noise: Variable lighting and soil backgrounds make it hard to distinguish a lesion from a shadow or a dirt clod.
  2. The "Small Target" Problem: Standard Convolutional Neural Networks (CNNs) use aggressive downsampling. By the time the data reaches the deeper layers of the network, the spatial information for a tiny 10-pixel lesion has often been "washed away."
  3. Computational Efficiency: Farmers need models that can run on edge devices in real-time, but many high-accuracy models are too memory-intensive.

Methods

The authors built CucumberDet on top of the RetinaNet architecture but introduced three major innovations:

  • Swin Transformer Backbone: Instead of a standard ResNet, they used a Swin Transformer (specifically the "Tiny" version). Unlike CNNs, which look at images through a small local window, Transformers use "self-attention" to perceive global information, helping the model understand the context of the entire leaf.
  • Small Target Feature Fusion Module (SFFM): This module acts as a "detail preserver." It uses symmetric large-kernel convolutions (11×1 and 1×11) to expand the receptive field without a massive computational hit, meticulously integrating fine-grained details from shallow layers into the detection process.
  • Multi-level Feature Adaptive Fusion Module (MFAFM): In many networks, information only flows "down" (from high resolution to low resolution). MFAFM creates an "upward elevator," allowing low-level detail to be adaptively transmitted to higher-level semantic features, preventing small targets from being misclassified as background noise.
  • Class-Balanced Focal Loss: To handle the fact that some diseases are rarer in the dataset than others, they tweaked the loss function to give more weight to underrepresented classes.

Datasets

The study utilized three datasets to prove the model's robustness:

  1. CDGE (Cucumber Disease Greenhouse Environment): A self-constructed dataset of 4,740 images captured in Shouguang, China. It includes five disease types (Anthracnose, Bacterial Wilt, Pythium Fruit Rot, Downy Mildew) and healthy samples.
  2. CucumberNegm: A publicly available benchmark used for comparative validation.
  3. CucumberSultana: Another public dataset used to test the model's generalization to unfamiliar data.

Key Insights and Ideas

  • Global Context for Local Problems: It seems counterintuitive, but to find a tiny spot, the model needs to understand the whole leaf. The Swin Transformer’s ability to model global relationships prevents the "tunnel vision" that often plagues standard CNNs.
  • The Information Bottleneck: The authors argue that suboptimal performance in small target detection stems from "insufficient feature representation." By focusing on the flow of information between layers (via SFFM and MFAFM), they effectively widened the bottleneck.
  • Efficiency vs. Accuracy: Through ablation studies, they found that the "Swin-Tiny" backbone provided the best balance, achieving high accuracy while maintaining a frame rate (23.6 FPS) suitable for real-time applications.

Key Results

  • Accuracy: CucumberDet achieved 92.5% mAP on the CDGE dataset, a 6.8% improvement over the original RetinaNet baseline.
  • Comparison: It outperformed heavy hitters like YOLOv8 (89.1% mAP) and Cascade R-CNN (88.9% mAP). It was particularly dominant in detecting Anthracnose and Downy Mildew.
  • Speed: The model runs at 23.6 Frames Per Second (FPS) on an NVIDIA RTX 3090, making it viable for real-time deployment on mobile agricultural robots.
  • Generalization: When tested on the public CucumberNegm dataset, the model reached an impressive 97.6% mAP, proving it isn't just "overfitting" to its own custom data.

Limitations and Future Work

While 23.6 FPS is impressive, it is slower than some versions of YOLO (which can exceed 70-90 FPS). For ultra-high-speed sorting lines, further optimization might be needed.

The authors plan to:

  1. Continue refining the algorithm to push accuracy even higher.
  2. Further optimize the model for even faster real-time performance on lower-power edge hardware.
  3. Explore the detection of even earlier-stage symptoms that are currently invisible to the naked eye.

Summary updated

Abstract

The cucumber disease images obtained from natural environments often contain noise such as variations in lighting and soil conditions, which significantly impact the accuracy of disease recognition. Additionally, existing detection models require large memory footprints, making real-time cucumber disease detection challenging. To address the challenges associated with detecting small targets in cucumber disease images, this study presents an algorithm named CucumberDet, which integrates global information perception and feature fusion. Initially, we employ the Swin Transformer as the backbone network for RetinaNet to augment the primary network’s feature extraction capabilities, thus enhancing its ability to extract information globally. Subsequently, to strengthen the network’s detection capabilities, especially for remote and small targets, we introduce a highly effective Small Target Feature Fusion Module (SFFM) to meticulously integrate detailed data of small targets into shallow feature maps. Finally, to further refine the network’s capability to identify multi-scale targets and facilitate the flow of low-level feature information to high-level features, we introduce a novel Multi-level Feature Adaptive Fusion Module (MFAFM). Encouraging detection results are obtained across three distinct datasets, with experimental findings on a self-compiled cucumber disease image dataset revealing that our proposed algorithm improves detection accuracy by 6.8% compared to the original RetinaNet baseline network. The proposed model achieves an mAP of 92.5%, with a parameter count of 38.39 million and a frame per second (FPS) rate of 23.6, underscoring its superior performance in detecting small targets and demonstrating its effectiveness across various application scenarios.
BibTeX
@inproceedings{wang2024detection,
  author = {Xuewei Wang and Jun Liu},
  title = {{Detection of small targets in cucumber disease images through global information perception and feature fusion}},
  booktitle = {Frontiers in Sustainable Food Systems},
  year = {2024},
  doi = {10.3389/fsufs.2024.1366387},
}
Figure