Rapid Automatic Cacao Pod Borer Detection Using Edge Computing on Low-End Mobile Devices
Abstract
:1. Introduction
2. Materials and Methods
2.1. Imaging Devices
2.2. Dataset Collection
2.3. Mobile CPB Detection Algorithm
2.4. Algorithm Optimization
2.4.1. Data-Centric Optimization
2.4.2. Model-Centric Optimization
2.4.3. Deployment-Centric Optimization
2.4.4. Operations-Centric Optimization
Algorithm 1: Asynchronous preprocessing, detection, and post-processing in the mobile application |
2.5. Algorithm Evaluation
- TP = true positive detections
- Ai = number of predictions from a 32-bit uncompressed model
- Pi = number of predictions from a 16-bit compressed model
2.6. Mobile Application Development and Usage
3. Results and Discussion
3.1. Algorithm Optimization Results
3.1.1. Data-Centric Optimization
3.1.2. Model-Centric Optimization
3.1.3. Deployment-Centric Optimization
3.1.4. Operations-Centric Optimization
3.2. Qualitative Algorithm Evaluation
3.3. CPB Count Comparison
3.4. Field Use and Cost-Benefit Analysis
4. Conclusions
Author Contributions
Funding
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Amalin, D.M.; Arcelo, M.; Almarinez, B.J.M.; Castillo, R.C.; Legaspi, J.C.; Santos, K.L.T.; Tavera, M.A.A.; Janairo, J.I.B.; Zhang, A. Field evaluation of the sex pheromone of the cacao pod borer (Conopomorpha cramerella snellen) in the Philippines. Front. Agron. 2023, 5, 1165299. [Google Scholar] [CrossRef]
- Shapiro, L.H.; Scheffer, S.J.; Maisin, N.; Lambert, S.; Purung, H.B.; Sulistyowati, E.; Vega, F.E.; Gende, P.; Laup, S.; Rosmana, A.; et al. Conopomorpha cramerella (Lepidoptera: Gracillariidae) in the malay archipelago: Genetic signature of a bottlenecked population? Ann. Entomol. Soc. Am. 2008, 101, 930–938. [Google Scholar] [CrossRef]
- Conopomorpha Cramerella (Cocoa pod Borer)|CABI Compendium. Available online: https://www.cabidigitallibrary.org/doi/10.1079/cabicompendium.7017 (accessed on 25 January 2024). [CrossRef]
- Teh, C.L.; Pang, J.T.Y.; Ho, C.T. Variation of the response of clonal cocoa to attack by cocoa pod borer Conopomorpha cramerella (Lepidoptera: gracillariidae) in Sabah. Crop Prot. 2006, 25, 712–717. [Google Scholar] [CrossRef]
- Beevor, P.S.; Mumford, J.D.; Shah, S.; Day, R.K.; Hall, D.R. Observations on pheromone-baited mass trapping for control of cocoa pod borer, Conopomorpha cramerella, in Sabah, East Malaysia. Crop Prot. 1993, 12, 134–140. [Google Scholar] [CrossRef]
- Vanhove, W.; Vanhoudt, N.; Bhanu, K.R.M.; Abubeker, S.; Feng, Y.; Yu, M.; Van Damme, P.; Zhang, A. Geometric isomers of sex pheromone components do not affect attractancy of Conopomorpha cramerella in cocoa plantations. J. Appl. Entomol. 2015, 139, 660–668. [Google Scholar] [CrossRef]
- Beevor, P.S.; Cork, A.; Hall, D.R.; Nesbitt, B.F.; Day, R.K.; Mumford, J.D. Components of female sex pheromone of cocoa pod porer moth, Conopomorpha cramerella. J. Chem. Ecol. 1986, 12, 1–23. [Google Scholar] [CrossRef] [PubMed]
- Rossi, V.; Sperandio, G.; Caffi, T.; Simonetto, A.; Gilioli, G. Critical success factors for the adoption of decision tools in IPM. Agronomy 2019, 9, 710. [Google Scholar] [CrossRef]
- Zhang, A.; Kuang, L.F.; Maisin, N.; Karumuru, B.; Hall, D.R.; Virdiana, I.; Lambert, S.; Bin Purung, H.; Wang, S.; Hebbar, P. Activity evaluation of cocoa pod borer sex pheromone in cacao fields. Environ. Entomol. 2008, 37, 719–724. [Google Scholar] [CrossRef]
- Rustia, D.J.A.; Chiu, L.Y.; Lu, C.Y.; Wu, Y.F.; Chen, S.K.; Chung, J.Y.; Hsu, J.C.; Lin, T.T. Towards intelligent and integrated pest management through an AIoT-based monitoring system. Pest Manag. Sci. 2022, 78, 4288–4302. [Google Scholar] [CrossRef]
- Liu, H.; Chahl, J.S. Proximal detecting invertebrate pests on crops using a deep residual convolutional neural network trained by virtual images. Artif. Intell. Agric. 2021, 5, 13–23. [Google Scholar] [CrossRef]
- Karar, M.E.; Alsunaydi, F.; Albusaymi, S.; Alotaibi, S. A new mobile application of agricultural pests recognition using deep learning in cloud computing system. Alex. Eng. J. 2021, 60, 4423–4432. [Google Scholar] [CrossRef]
- Chen, J.W.; Lin, W.J.; Cheng, H.J.; Hung, C.L.; Lin, C.Y.; Chen, S.P. A smartphone-based application for scale pest detection using multiple-object detection methods. Electronics 2021, 10, 372. [Google Scholar] [CrossRef]
- Gonçalves, J.; Silva, E.; Faria, P.; Nogueira, T.; Ferreira, A.; Carlos, C.; Rosado, L. Edge-compatible deep learning models for detection of pest outbreaks in viticulture. Agronomy 2022, 12, 3052. [Google Scholar] [CrossRef]
- StatCounter. Most Popular Phone Brands in the Philippines. 2023. Available online: https://www.statista.com/statistics/938806/philippines-market-share-of-leading-mobile-brands// (accessed on 25 January 2024).
- Dwyer, B.; Nelson, J.; Solawetz, J. Roboflow (Version 1.0). Software Available from Roboflow. Computer Vision. 2022. Available online: https://roboflow.com/ (accessed on 28 January 2024).
- Rustia, D.J.A.; Chao, J.J.; Chiu, L.Y.; Wu, Y.F.; Chung, J.Y.; Hsu, J.C.; Lin, T.T. Automatic greenhouse insect pest detection and recognition based on a cascaded deep learning classification method. J. Appl. Entomol. 2021, 145, 206–222. [Google Scholar] [CrossRef]
- Unel, F.O.; Ozkalayci, B.O.; Cigla, C. The power of tiling for small object detection. In Proceedings of the 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops (CVPRW), Long Beach, CA, USA, 16–17 June 2019; pp. 582–591. [Google Scholar] [CrossRef]
- Cui, M.; Gong, G.; Chen, G.; Wang, H.; Jin, M.; Mao, W.; Lu, H. LC-YOLO: A lightweight model with efficient utilization of limited detail features for small object detection. Appl. Sci. 2023, 13, 3174. [Google Scholar] [CrossRef]
- Saleem, M.H.; Velayudhan, K.K.; Potgieter, J.; Arif, K.M. Weed identification by single-stage and two-stage neural networks: A study on the impact of image resizers and weights optimization algorithms. Front. Plant Sci. 2022, 13, 850666. [Google Scholar] [CrossRef]
- Zhang, D.; Zhang, W.; Li, F.; Liang, K.; Yang, Y. PNANet: Probabilistic two-stage detector using pyramid non-local attention. Sensors 2023, 23, 4938. [Google Scholar] [CrossRef]
- Jocher, G.; Chaurasia, A.; Qiu, J. Ultralytics YOLO (Version 8.1.18). Software Available from GitHub. Computer Vision. 2023. Available online: https://github.com/ultralytics/ultralytics (accessed on 25 January 2024).
- Lin, T.Y.; Dollár, P.; Girshick, R.; He, K.; Hariharan, B.; Belongie, S. Feature pyramid networks for object detection. arXiv 2017, arXiv:1612.03144. [Google Scholar]
- Liu, L.; Ouyang, W.; Wang, X.; Fieguth, P.; Chen, J.; Liu, X.; Pietikäinen, M. Deep learning for generic object detection: A survey. Int. J. Comput. Vision 2020, 128, 261–318. [Google Scholar] [CrossRef]
- Xu, M.; Yoon, S.; Fuentes, A.; Park, D.S. A comprehensive survey of image augmentation techniques for deep learning. Pattern Recognit. 2023, 137, 109347. [Google Scholar] [CrossRef]
- Shorten, C.; Khoshgoftaar, T.M. A survey on image data augmentation for deep learning. J. Big Data 2019, 6, 60. [Google Scholar] [CrossRef]
- ONNX Runtime. Model Optimizations. Available online: https://onnxruntime.ai/docs/performance/model-optimizations/ (accessed on 16 January 2024).
- Intel. Choose FP16, FP32 or Int8 for Deep Learning Models. Available online: https://www.intel.com/content/www/us/en/developer/articles/technical/should-i-choose-fp16-or-fp32-for-my-deep-learning-model.html (accessed on 16 January 2024).
- Padilla, R.; Netto, S.; da Silva, E. A Survey on Performance Metrics for Object-Detection Algorithms. In Proceedings of the 2020 International Conference on Systems, Signals and Image Processing (IWSSIP), Online, 1–3 July 2020. [Google Scholar] [CrossRef]
- Alfonso-Francia, G.; Pedraza-Ortega, J.C.; Badillo-Fernández, M.; Toledano-Ayala, M.; Aceves-Fernandez, M.A.; Rodriguez-Resendiz, J.; Ko, S.B.; Tovar-Arriaga, S. Performance Evaluation of Different Object Detection Models for the Segmentation of Optical Cups and Discs. Diagnostics 2022, 12, 3031. [Google Scholar] [CrossRef] [PubMed]
- Kim, S.; Kim, H. A New Metric of Absolute Percentage Error for Intermittent Demand Forecasts. Int. J. Forecast. 2016, 32, 669–679. [Google Scholar] [CrossRef]
- Virtanen, P.; Gommers, R.; Oliphant, T.E.; Haberland, M.; Reddy, T.; Cournapeau, D.; Burovski, E.; Peterson, P.; Weckesser, W.; Bright, J.; et al. SciPy 1.0: Fundamental algorithms for scientific computing in python. Nat. Methods 2020, 17, 261–272. [Google Scholar] [CrossRef]
- Pandas Development Team. Pandas-Dev/Pandas: Pandas. Available online: https://pandas.pydata.org (accessed on 25 January 2024). [CrossRef]
- Model Metadata Struct Reference. Available online: https://onnxruntime.ai/docs/api/c/struct_ort_1_1_model_metadata.html (accessed on 15 January 2024).
- Hacinas, E.A.S.; Querol, L.S.; Acero, L.A.; Arcelo, M.; Amalin, D.M.; Rustia, D.J.A. Automated Cocoa Pod Borer Detection Using an Edge Computing-Based Deep Learning Algorithm; American Society of Agricultural and Biological Engineers: St. Joseph Charter Township, MI, USA, 2022. [Google Scholar] [CrossRef]
Device | Camera Resolution (px) | CPU | RAM | USD | PHP |
---|---|---|---|---|---|
Cherry Mobile Flare S8 Deluxe (Cherry Mobile, Manila, Philippines) | 3456 × 4608 | Octa-Core A55 @1.6 GHz | 4 GB | 90 | 5000 |
Huawei Nova Y7 (Huawei, Shenzhen, China) | 4000 × 3000 | Octa-Core A53 @2.2 GHz | 4 GB | 155 | 8500 |
Realme C3 (Realme, Guangdong, China) | 3264 × 2448 | Octa-Core A75 @1.8 GHz | 2 GB | 90 | 5000 |
Dataset | Collection Date | Number of Images Based on CPB Density | ||
---|---|---|---|---|
Low (n < 10) | Medium (10 ≤ n < 30) | High (n ≥ 30) | ||
Training | 2017–2021 | 226 | 107 | 56 |
Validation | 2017–2021 | 60 | 25 | 14 |
Testing | 2022–2023 | 56 | 25 | 31 |
Augmentation Method | Training | Validation | Testing |
---|---|---|---|
None | 389 | 99 | 112 |
Rotation: 90°, 180°, 270° | 1556 | 396 | 112 |
Flip: Horizontal, Vertical, Origin | 1556 | 396 | 112 |
Model Size | Input Size (px) | confthres | NMSthres | F1-Score |
---|---|---|---|---|
Nano | 320 × 320 | 0.2 | 0.2 | 0.86 |
640 × 640 | 0.3 | 0.2 | 0.86 | |
Small | 320 × 320 | 0.2 | 0.2 | 0.88 |
640 × 640 | 0.2 | 0.2 | 0.88 | |
Medium | 320 × 320 | 0.2 | 0.2 | 0.88 |
640 × 640 | 0.2 | 0.2 | 0.87 | |
Large | 320 × 320 | 0.2 | 0.2 | 0.88 |
640 × 640 | 0.2 | 0.2 | 0.89 |
Model | Precision | Compressed | Size | MAPE |
---|---|---|---|---|
YOLOv8-s | fp32 | No | 22.5 MB | Baseline |
YOLOv8-s | fp32 | Yes | 44.7 MB | 3.48% |
YOLOv8-s | fp16 | Yes | 22.6 MB | 3.31% |
Model | Input Size (px) | Operation | Avg. Computation Time |
---|---|---|---|
YOLOv8-s | 320 × 320 | Asynchronous | 33.5 s (7.24 × faster) |
YOLOv8-s | 640 × 640 | Asynchronous | 113.70 s (2.15 × faster) |
YOLOv8-s | 320 × 320 | Synchronous | 158.2 s (1.54 × faster) |
YOLOv8-s | 640 × 640 | Synchronous | 243.8 s (baseline) |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2024 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Hacinas, E.A.S.; Querol, L.S.; Santos, K.L.T.; Matira, E.B.; Castillo, R.C.; Arcelo, M.; Amalin, D.; Rustia, D.J.A. Rapid Automatic Cacao Pod Borer Detection Using Edge Computing on Low-End Mobile Devices. Agronomy 2024, 14, 502. https://doi.org/10.3390/agronomy14030502
Hacinas EAS, Querol LS, Santos KLT, Matira EB, Castillo RC, Arcelo M, Amalin D, Rustia DJA. Rapid Automatic Cacao Pod Borer Detection Using Edge Computing on Low-End Mobile Devices. Agronomy. 2024; 14(3):502. https://doi.org/10.3390/agronomy14030502
Chicago/Turabian StyleHacinas, Eros Allan Somo, Lorenzo Sangco Querol, Kris Lord T. Santos, Evian Bless Matira, Rhodina C. Castillo, Mercedes Arcelo, Divina Amalin, and Dan Jeric Arcega Rustia. 2024. "Rapid Automatic Cacao Pod Borer Detection Using Edge Computing on Low-End Mobile Devices" Agronomy 14, no. 3: 502. https://doi.org/10.3390/agronomy14030502
APA StyleHacinas, E. A. S., Querol, L. S., Santos, K. L. T., Matira, E. B., Castillo, R. C., Arcelo, M., Amalin, D., & Rustia, D. J. A. (2024). Rapid Automatic Cacao Pod Borer Detection Using Edge Computing on Low-End Mobile Devices. Agronomy, 14(3), 502. https://doi.org/10.3390/agronomy14030502