AI in Pest Detection: Melon Fruit Fly

AI in Pest Detection: Melon Fruit Fly

Bactrocera cucurbitae and other Tephritidae pests have traditionally been monitored through manual counting, a time-consuming and often inaccurate method.

Given the adverse effects of pesticides on the environment and human health, a more precise, automated solution is essential. YOLO_MRC addresses these needs by enabling efficient pest monitoring, allowing timely and precise responses to pest populations and reducing pesticide misuse.


Trapping and detection devices. (a) Outdoor trapping and detection devices. (b) Method of using an attractant. Source: Wei & Zhan, 2024
Recording of the dataset. (a) Recording the dataset in a laboratory environment. (b) Bactrocera cucurbitae video data. Source: Wei & Zhan, 2024

Model Architecture and Innovations

YOLO_MRC is based on the YOLOv8n model, selected for its small size and high speed. The following improvements distinguish YOLO_MRC from the baseline model:

Multicat Module:

  • The Multicat module replaces the upsample and concatenate layers in YOLOv8’s head network, using an attention mechanism that enhances focus on specific target features. By doing so, the network better identifies Bactrocera cucurbitae against varied backgrounds, reducing errors caused by background noise.
  • The module takes three input feature maps of varying sizes, processes each, and combines them with attention-weighted outputs, emphasizing features more relevant to pest detection.


YOLOv8 network structure. Source: Wei & Zhan, 2024


The Multicat module structure. Source: Wei & Zhan, 2024
Division diagram of the area range in YOLOv8. Source: Wei & Zhan, 2024

C2flite Module module replaces standard C2f modules in two critical layers of the backbone network, focusing on deeper feature extraction and reducing shallow feature redundancies. This change reduces model complexity and the number of parameters, enabling faster inference without sacrificing accuracy.


Flowchart of the method. Source: Wei & Zhan, 2024

Reduced Detection Head: YOLO_MRC reduces the number of detection heads from three to two, removing the large-scale head responsible for large object detection. This adjustment aligns with the need to detect small pests, significantly reducing computational overhead and further optimizing the model for lightweight applications.


Mosaic data enhancement effect. Source: Wei & Zhan, 2024


YOLO_MRC network structure. Source: Wei & Zhan, 2024

Experimentation and Evaluation

To validate YOLO_MRC, extensive experiments were conducted on datasets featuring Bactrocera cucurbitae, both in controlled lab environments and in practical agricultural settings. The experiments compared YOLO_MRC’s performance against several other leading models, including variations of YOLO (e.g., YOLOv5Ghost, YOLOv7Tiny) and Faster-RCNN, across a variety of metrics.

Performance Metrics:

  • Accuracy: YOLO_MRC achieved a mean average precision ([email protected]) of 99.3%, highlighting its ability to detect pests accurately. It also reached an average pest counting accuracy of 94% when compared to manual counts, underscoring its effectiveness in real-world applications.
  • Efficiency: The model achieved a 63.68% reduction in parameters and a 19.75% decrease in GFLOPs (a measure of computational complexity), resulting in a 5% reduction in processing time.
  • Model Size: YOLO_MRC is only 2.4 MB, making it deployable on resource-constrained devices, like portable agricultural equipment.


Heatmaps for Grad-cam visualization. Source: Wei & Zhan, 2024

In the figure above: (a) and (d) are the raw data. (b) and (e) Heatmaps without the addition of Multicat modules. (c) and (f) Heatmaps with the addition of Multicat modules. By comparison, the heat of the detected target becomes more concentrated after adding the Multicat modules.

Benchmark Comparisons:

  • YOLO_MRC was compared against other models on both specific pest datasets and multiclass insect detection tasks (using Pest_24_640). It consistently demonstrated faster processing times, with an average inference time of 5.6 ms per image, outperforming other models. For instance, YOLOv5Ghost required 9.5 ms, and Faster-RCNN took 65 ms.
  • In multiclass tests, YOLO_MRC reached an accuracy of 70.4% on the Pest_24_640 dataset, with an inference time of only 3.6 ms per image, confirming its potential for broader pest management applications.


Detection and counting results of five models in the face of overlapping occlusions. Source: Wei & Zhan, 2024

In the figure above: Among these five models, the best performing model is YOLO_MRC, which yields correct detection and counting results for overlapping occlusions and is consistent with manual counting results in four images.

Ablation Studies and Combination Experiments

The model’s key components were tested individually and in combination to assess their impact:

  • Ablation Studies: The studies examined the effects of each module (Multicat, C2flite, and reduced detection heads) separately, showing that each contributed to either accuracy improvements or efficiency gains.
  • Combination Experiments: Combining Multicat with deletion mode B (removing large-object detection features) and the C2flite module yielded the best results, balancing high precision with reduced model complexity.


Comparison Experiment 1. Source: Wei & Zhan, 2024


Comparison Experiment 2. Source: Wei & Zhan, 2024


False detection results for YOLO_MRC. The error detection counting results of YOLO_MRC for several overlapping occlusion cases. Source: Wei & Zhan, 2024


Benchmark experiments. Source: Wei & Zhan, 2024

Practical Implications and Applications

The YOLO_MRC model holds promise for real-world agricultural monitoring, where it can serve as an automated solution for early pest detection. By providing timely data on pest populations, YOLO_MRC enables more targeted and judicious pesticide use, mitigating environmental damage and potential health risks. Its lightweight nature and low power requirements make it suitable for deployment on mobile and embedded devices, allowing for continuous, in-field pest monitoring.

Limitations and Future Work

While YOLO_MRC excels in detecting Bactrocera cucurbitae, it shows reduced accuracy in multiclass pest detection, especially for pests of varying morphologies and sizes.

The paper suggests future research to adapt the model for a broader range of pest types, particularly in handling overlapping objects and occlusions more robustly.         

Additionally, planned improvements include testing YOLO_MRC on outdoor field data and deploying it on mobile devices, such as the Jetson Nano, to explore its potential in various agricultural scenarios.


Conclusion

YOLO_MRC successfully integrates high detection accuracy, fast processing speeds, and a small footprint, making it an ideal tool for real-time pest management. Its combination of innovations positions it as an essential asset for sustainable agriculture, where timely pest control is critical for crop protection and environmental preservation.


Citation

Wei, M., & Zhan, W. (2024). YOLO_MRC: A fast and lightweight model for real-time detection and individual counting of Tephritidae pests. Ecological Informatics, 79, 102445. https://doi.org/10.1016/j.ecoinf.2023.102445


What's on

If you'd like to receive the regular 'AI in Agriculture' newsletter in your inbox, simply add your email to my mailing list.

Join over 9,100 readers who enjoy weekly updates on AI advancements in agriculture!

Get the 'AI in Agriculture' newsletter delivered straight to your inbox! Simply click the image above and enter your email to join my mailing list
Get the 'AI in Agriculture' newsletter delivered straight to your inbox! Simply click the image above and enter your email to join my mailing list

AI for Fruits Phenotyping and Quality Assurance

Free mobile application Petiole Pro brings AI to plant phenotyping and quality assurance of cannabis crops
Free mobile application Petiole Pro brings AI to plant phenotyping and quality assurance of cannabis crops
To get more information about crop phenotyping capabilities with mobile - ask Petiole Pro


Brian B.

Health-tech comms | CLEAR, MEMORABLE, MARKET-READY | DM me

1 个月

Maryna Kuzmenko, Ph.D ????, this is thrilling! A valuable, real-life use case for the potential of AI. (Maybe the first real value I’ve seen!)

要查看或添加评论,请登录