• International Journal of Technology (IJTech)
  • Vol 17, No 3 (2026)

Fruit Fly Detection Based on Wingbeat Sound Using Embedded Artificial Intelligence

Fruit Fly Detection Based on Wingbeat Sound Using Embedded Artificial Intelligence

Title: Fruit Fly Detection Based on Wingbeat Sound Using Embedded Artificial Intelligence
Van-Khanh Nguyen, Vy-Khang Tran, Chi-Ngon Nguyen

Corresponding email:


Cite this article as:
Nguyen, V.-K., Tran, V.-K., & Nguyen, C.-N. (2026). Fruit fly detection based on wingbeat sound using embedded artificial intelligence. International Journal of Technology, 17 (3), 1012–1030.


16
Downloads
Van-Khanh Nguyen 1. Programmable Logic Controller Technology and IIoT Laboratory, College of Engineering, Can Tho University, Can Tho 94119, Vietnam 2. College of Engineering, Can Tho University, Can Tho 94119, Vietn
Vy-Khang Tran Programmable Logic Controller Technology and IIoT Laboratory, College of Engineering, Can Tho University, Can Tho 94119, Vietnam
Chi-Ngon Nguyen Nam Can Tho University, Can Tho 94118, Vietnam
Email to Corresponding Author

Abstract
Fruit Fly Detection Based on Wingbeat Sound Using Embedded Artificial Intelligence

The highly invasive oriental fruit fly has caused significant agricultural losses worldwide. Electronic traps have been widely studied for fruit fly detection and counting. However, research focusing on applying acoustic sensors to identify fruit flies based on their wingbeat sound is currently lacking. This study focused on identifying trapped oriental fruit flies based on wingbeat sound data. An acoustic sensor was integrated into the funnel trap to record the wingbeat sounds of trapped flies along with ambient environmental noise. The trap was deployed in an apple orchard for two months to collect data. A spectrogram transformation and Mel-filter bank were applied to process the captured audio, generating two distinct sets of spectrogram images. A deep learning model based on convolutional neural network architecture was then designed and deployed on an ESP32 microcontroller to classify the wingbeat sounds of fruit flies and other environmental sounds. The trained model’s field experiment in the orchard showed that the model could classify the sound of fruit fly wingbeat in real-time audio streams with an accuracy of up to 96.86%. This demonstrates the practical applicability of the sound-sensor-based fruit-fly identification method. In addition, implementing the deep learning model on a microcontroller results in a compact, low-power, and cost-effective electronic trap. As a result, the compact design and low power consumption make this solution a promising approach for real-time monitoring and early pest detection in agricultural environments. However, its broader applicability requires further validation across more diverse datasets, longer deployment periods, and varying environmental conditions.

Automation trap; Acoustic sensor; CNN architecture; Embedded system; Pest detection

Supplementary Material
FilenameDescription
R3-EECE-8284-20260519134146.pdf ---
References

Abdel-Hamid, O., Deng, L., & Yu, D. (2013). Exploring convolutional neural network structures and optimization techniques for speech recognition. Interspeech, 2013, 1173–1175. https://doi.org/10.21437/Interspeech.2013-744

Abdul, Z., & Al-Talabani, A. (2022). Mel frequency cepstral coefficient and its applications: A review. IEEE Access, 10, 122136–122158. https://doi.org/10.1109/ACCESS.2022.3223444

Ali, M., Sayeed, M., & Abdul Razak, S. (2025). HDL-Net: Hybrid deep learning and IoT network-based system for pest detection using pest sound analytics. Discover Applied Sciences, 7 (10), 1155. https://doi.org/10.1007/s42452-025-07747-y

Audacity Team. (2017). The name Audacity® is a registered trademark of Dominic Mazzoni [http://audacity.sourceforge.net].

Bogerding, M. (2017). KissFFT library [https://github.com/mborgerding/kissfft].

Espressif Systems. (2021). ESP32 series datasheet [https://www.espressif.com].

Google. (2024). Post-training quantization [https://ai.google.dev/edge].

Hahn, F., Valle, S., Rendón, R., Oyorzabal, O., & Astudillo, A. (2023). Mango fruit fly trap detection using different wireless communications. Agronomy, 13 (7), 1736. https://doi.org/10.3390/agronomy13071736

Hendel, F. (1912). H. sauter’s formosa-ausbeute: Genus dacus (diptera). Supplementa Entomologica, 1, 13–24.

Hien, N., Trang, V., Thanh, V., Lien, H., Thang, Xuyen, L., & Pereira, R. (2019). Fruit fly area-wide integrated pest management in dragon fruit in Binh Thuan province, Viet Nam. In Area-wide management of fruit fly pests (pp. 343–347). CRC Press.

Huang, R., Yao, T., Zhan, C., Zhang, G., & Zheng, Y. (2021). A motor-driven and computer vision-based intelligent e-trap for monitoring citrus flies. Agriculture, 11 (5), 460. https://doi.org/10.3390/agriculture11050460

Jaffar, S., Rizvi, S., & Lu, Y. (2023). Understanding the invasion, ecological adaptations, and management strategies of Bactrocera dorsalis in China: A review. Horticulturae, 9 (9), 1004. https://doi.org/10.3390/horticulturae9091004

Kalfas, I., De Ketelaere, B., Beliën, T., & Saeys, W. (2022). Optical identification of fruit fly species based on their wingbeats using convolutional neural networks. Frontiers in Plant Science, 13, 812506. https://doi.org/10.3389/fpls.2022.812506

Khalid, A., Anjum, M., Naveed, S., & Hussain, W. (2025). Whispers in the air: Designing acoustic classifiers to detect fruit flies from afar. Smart Agricultural Technology, 10, 100738. https://doi.org/10.1016/j.atech.2024.100738

Kibira, M., Affognon, H., Njehia, B., Muriithi, B., Mohamed, S., & Ekesi, S. (2015). Economic evaluation of integrated management of fruit fly in mango production in Embu County, Kenya. African Journal of Agricultural and Resource Economics, 10 (4), 343–353. https://doi.org/10.22004/ag.econ.211846

Le, A., Pham, D., Pham, D., & Vo, H. (2021). AlertTrap: A study on object detection in remote insect trap monitoring system using on-the-edge deep learning platform. arXiv preprint arXiv:2112.13341. https://doi.org/10.47852/bonviewJCCE42023264

Lello, F., Dida, M., Mkiramweni, M., Matiko, J., Akol, R., Nsabagwa, M., & Katumba, A. (2023). Fruit fly automatic detection and monitoring techniques: A review. Smart Agricultural Technology, 100294. https://doi.org/10.1016/j.atech.2023.100294

Liquido, N., McQuate, G., Birnbaum, A., Hanlin, M., Nakamichi, K., Inskeep, J., Ching, A., Marnell, S., & Kurashima, R. (2017). A review of recorded host plants of oriental fruit fly, Bactrocera (Bactrocera) dorsalis (Hendel) (Diptera: Tephritidae), version 3.0 [USDA CPHST Online Database. https://coffhi.cphst.org/].

Long, K., Nghiep, H., & Oanh, N. (2022). Seasonal population dynamics of the oriental fruit fly, Bactrocera dorsalis (Hendel), in mango orchards, Cao Lanh City, Dong Thap Province. Tap chi Khoa hoc DH Dong Thap, 11 (5), 85–92.

Mankin, R., Machan, R., & Jones, R. (2006). Field testing of a prototype acoustic device for detection of Mediterranean fruit flies flying into a trap. Proceedings of the 7th International Symposium on Fruit Flies of Economic Importance.

Martins, V., Freitas, L., de Aguiar, M., de Brisolara, L., & Ferreira, P. (2019). Deep learning applied to the identification of fruit fly in intelligent traps. 2019 IX Brazilian Symposium on Computing Systems Engineering (SBESC). https://doi.org/10.1109/SBESC49506.2019.9046088

Molina-Rotger, M., Morán, A., Miranda, M., & Alorda-Ladaria, B. (2023). Remote fruit fly detection using computer vision and machine learning-based electronic trap. Frontiers in Plant Science, 14, 1241576. https://doi.org/10.3389/fpls.2023.1241576

Muriithi, B., Affognon, H., Diiro, G., Kingori, S., Tanga, C., Nderitu, P., Mohamed, S., & Ekesi, S. (2016). Impact assessment of integrated pest management (IPM) strategy for suppression of mango-infesting fruit flies in Kenya. Crop Protection, 81, 20–29.

Mutamiswa, R., Nyamukondiwa, C., Chikowore, G., & Chidawanyika, F. (2021). Overview of oriental fruit fly, Bactrocera dorsalis (Hendel) (Diptera: Tephritidae) in Africa: From invasion, bio-ecology to sustainable management. Crop Protection, 141, 105492. https://doi.org/10.1016/j.cropro.2015.11.014

Nanda, M., Seminar, K., Nandika, D., & Maddu, A. (2018). Discriminant analysis as a tool for detecting the acoustic signals of termites Coptotermes curvignathus (Isoptera: Rhinotermitidae). International Journal of Technology, 9 (4), 840–851. https://doi.org/10.14716/ijtech.v9i4.455 

Navarro-Llopis, V., & Vacas, S. (2014). Mass trapping for fruit fly control. In Trapping and the detection, control, and regulation of tephritid fruit flies: Lures, area-wide programs, and trade implications (pp. 513–555). https://doi.org/10.1007/978-94-017-9193-9_15

Nguyen, V., Tran, V., & Nguyen, C. (2025). Towards fruit fly automatic counting: Electronic trap design and long-term feature data acquisition. International Journal of Applied Science and Engineering, 22, 2025102. https://doi.org/10.6703/IJASE.20250922(3).004

Oanh, N., & Duc, H. (2020). An initial investigation of pest species on Dai Loan mango planting in Cao Lanh City, Dong Thap Province, Vietnam. Tap chi Khoa hoc DH Dong Thap, 9 (5), 68–76.

Opoku, E., Haseeb, M., Rodriguez, E., Steck, G., & Cabral, M. (2025). Economically important fruit flies (Diptera: Tephritidae) in Ghana and their regulatory pest management. Insects, 16 (3), 285. https://doi.org/10.3390/insects16030285

Oppenheim, A., & Schafer, R. (2009). Discrete-time signal processing (3rd). Pearson.

Potamitis, I., Rigakis, I., & Fysarakis, K. (2014). The electronic McPhail trap. Sensors, 14 (12), 22285–22299. https://doi.org/10.3390/s141222285

Sandrini-Moraes, F., Edson Nava, D., Scheunemann, T., & Santos da Rosa, V. (2019). Development of an optoelectronic sensor for detecting and classifying fruit fly (Diptera: Tephritidae) for use in real-time intelligent traps. Sensors, 19 (5), 1254. https://doi.org/10.3390/s19051254

Shetty, M., & Kumar, Y. (2025). Audio-based classification of insect species using machine learning models: Cicada, beetle, termite, and cricket. arXiv preprint. https://doi.org/arXiv:2502.13893

Tran, T., & Nguyen, T. (2023). Determination of species composition and effect of plant extracts to prevent the eggs-laying of fruit flies, Bactrocera spp., infesting jackfruit. https://doi.org/10.22271/j.ento.2023.v11.i3a.9195

Trombik, J., Ward, S., Norrbom, A., & Liebhold, A. (2023). Global drivers of historical true fruit fly (Diptera: Tephritidae) invasions. Journal of Pest Science, 96 (1), 345–357. https://doi.org/10.1007/s10340-022-01498-0

Varma, A., Bateshwar, V., Rathi, A., & Singh, A. (2021). Acoustic classification of insects using signal processing and deep learning approaches. 2021 8th International Conference on Signal Processing and Integrated Networks (SPIN), 1048–1052. https://doi.org/10.1109/SPIN52536.2021.9566121

Warden, P., & Situnayake, D. (2019). TinyML: Machine learning with TensorFlow Lite on Arduino and ultra-low-power microcontrollers. O’Reilly Media.

Wijekoon, C., Ganehiarachchi, M., Wegiriya, H., & Vidanage, S. (2024). The variation of oviposition preference and host susceptibility of the oriental fruit fly (Bactrocera dorsalis Hendel) (Diptera: Tephritidae) on commercial mango varieties. Advances in Agriculture, 2024, 7490120.

Zeng, Y., Reddy, G., Li, Z., Qin, Y., Wang, Y., Pan, X., Jiang, F., Gao, F., & Zhao, Z. (2019). Global distribution and invasion pattern of oriental fruit fly, Bactrocera dorsalis (Diptera: Tephritidae). Journal of Applied Entomology, 143 (3), 165–176. https://doi.org/10.1111/jen.12582