Detection of Wheat Pest and Disease in Complex Backgrounds Based on Improved YOLOv8 Model

Dandan Zhong, Penglin Wang, Jie Shen, Dongxu ZhangInternational Journal of Advanced Computer Science and Applications 2025 · DOI

This research paper presents MGT-YOLO, an optimized deep learning architecture designed to solve one of the most persistent headaches in precision agriculture: detecting tiny pests and subtle disease symptoms against the visually "noisy" backdrop of a wheat field. By modifying the YOLOv8 framework with edge-enhancement and transformer modules, the authors achieved significant accuracy gains without sacrificing the real-time speeds necessary for field deployment.

TL;DR

MGT-YOLO enhances the YOLOv8 object detection model by integrating multi-scale edge amplification and global context modeling to better identify small-scale wheat pests and diseases. The model achieves an 89.5% mAP on a custom dataset, outperforming the baseline by 2.0% while maintaining a high inference speed of 161.4 FPS.

What Problem Does This Paper Address?

In agricultural computer vision, the "small target problem" is a major hurdle. Pests like aphids or diseases like powdery mildew often manifest as minute spots or fine textures that are easily lost during the downsampling process of standard neural networks. Furthermore, the complex, cluttered background of a wheat field—filled with overlapping leaves, varying light, and soil—creates significant "interference" that leads to high false-positive rates.

While two-stage detectors (like Faster R-CNN) are accurate, they are too slow for real-time use on drones or edge devices. Conversely, standard single-stage detectors (like YOLOv8) often struggle to capture the fine-grained details and long-range spatial dependencies needed to distinguish a small pest from a speck of dirt.

Methods

The authors introduce three strategic architectural enhancements to the YOLOv8 framework:

  1. Multi-scale Edge Augmentation Mechanism (MEAM): Integrated into the backbone network, MEAM uses average pooling and 1x1 convolutions across multiple scales to explicitly capture and amplify edge information. This helps the model retain the "sharpness" of small features that usually get blurred in deeper layers.
  2. C2f_GlobalContext Module: The authors replaced standard C2f modules in the "neck" (feature fusion) part of the network with a version that incorporates a Global Context (GC) mechanism. This uses an attention-based approach to model long-range dependencies, allowing the model to understand the relationship between a small object and its broader surroundings.
  3. Vision Transformer (ViT) Layer: A ViT layer with adaptive window attention was added to the neck. This specifically addresses the challenge of capturing dependencies among fragmented patterns, which is critical for preserving the features of small-scale diseases.
  4. Loss Function: The model utilizes the CIoU (Complete Intersection over Union) loss function, which accounts for the overlap area, central point distance, and aspect ratio, leading to more stable and accurate bounding box regression.

Datasets

The study utilizes a custom-built dataset called WheatData:

  • Size: 2,393 high-resolution images.
  • Classes: Six common wheat threats: baifen (powdery mildew), chimei (fusarium head blight), heisui (smut), yeman (wheat mite), qianying (leaf miner), and yachong (aphid).
  • Diversity: Images capture various growth stages and diverse agricultural settings to ensure the model can handle real-world complexity.

Key Insights and Ideas

  • Edges are Feature Goldmines: For agricultural diseases, the "texture" and "edge" of a fungal spot are often more discriminative than its color. By explicitly designing a module (MEAM) to save these edges, the model avoids the "information wash-out" typical of deep CNNs.
  • Contextual Reasoning: Small objects are hard to identify in a vacuum. The GlobalContext module essentially allows the network to ask, "Does this tiny white spot make sense given the rest of the leaf's health?" This reduces false positives caused by background noise.
  • The Efficiency Sweet Spot: Adding Transformers often tanks a model's frame rate. However, by strategically placing a lightweight ViT layer only in the neck, the authors gained the benefits of global attention while keeping the parameter count low (5.9M) and the speed high (161.4 FPS).

Key Results

The MGT-YOLO model was benchmarked against the baseline YOLOv8 and several state-of-the-art (SOTA) models:

  • Overall Accuracy: Reached 89.5% [email protected], a 2.0% absolute improvement over baseline YOLOv8.
  • Small Target Gains: Significant improvements were seen in the hardest-to-detect classes: +5.3% for powdery mildew and +6.8% for smut disease.
  • Inference Speed: Maintained 161.4 FPS, which is well above the threshold for real-time video processing (usually ~30 FPS).
  • Efficiency: Despite the added complexity, the model remains lightweight with only 5.9 million parameters, making it suitable for deployment on mobile agricultural robots or handheld devices.

Limitations and Future Work

  • Class Confusion: The authors noted significant confusion between heisui (smut) and chimei (fusarium). This is because both diseases affect the wheat spike similarly. Future work may need even higher-resolution feature extraction or multi-spectral data to differentiate these.
  • Dataset Scale: While 2,393 images is a solid start, deep learning models generally benefit from much larger, more geographically diverse datasets to ensure global "universality."
  • Multimodal Integration: The authors suggest that future iterations could incorporate multimodal large models—perhaps combining visual data with environmental sensors (humidity, temperature) to predict disease outbreaks more accurately.

Summary updated

Abstract

Detecting wheat diseases and pests, particularly those characterized by small targets amidst complex background interference, presents a significant challenge in agricultural re-search. To address this issue and achieve precise and efficient detection, we propose an enhanced version of YOLOv8, termed MGT-YOLO, which incorporates multi-scale edge enhancement and visual remote dependency mechanisms. Our methodology begins with the creation of a comprehensive dataset, WheatData, comprising 2393 high-resolution images capturing various wheat diseases and pests across different growth stages in diverse agricultural settings. To improve the detection of small targets, we implemented a multi-scale edge amplification technique within the backbone network of YOLOv8, enhancing its ability to capture minute details of wheat diseases and pests. Furthermore, we introduced the C2f GlobalContext module in the neck network, which integrates global contextual relationships and facilitates the fusion of features from small-sized objects by leveraging remote dependencies in visual imagery. Additionally, we incorporated a Vision Transformer module into the neck network to enhance the processing efficiency of small-scale disease and pest features. The proposed MGT-YOLO network was rigorously evaluated on the WheatData dataset. The results demonstrated significant improvements, with [email protected] values of 90.0% for powdery mildew and 65.5% for smut disease, surpassing the baseline YOLOv8 by 5.3% and 6.8%, respectively. The overall [email protected] reached 89.5%, representing a 2.0% improvement over YOLOv8 and outperforming other state-of-the-art detection methods. These findings suggest that MGT-YOLO is a promising solution for real-time detection of agricultural diseases and pests, offering enhanced accuracy and efficiency in complex agricultural environments.
BibTeX
@article{zhong2025detection,
  author = {Dandan Zhong and Penglin Wang and Jie Shen and Dongxu Zhang},
  title = {{Detection of Wheat Pest and Disease in Complex Backgrounds Based on Improved YOLOv8 Model}},
  journal = {International Journal of Advanced Computer Science and Applications},
  year = {2025},
  doi = {10.14569/ijacsa.2025.01603104},
}
Figure