Lightweight deep learning model for real-time acoustic bird pest detection on edge microcontrollers
Abstract
Agricultural pest management in resource-limited regions faces significant challenges from avian pests like Quelea species, which cause substantial grain crop losses. Yet current management relies mainly on labor-intensive manual monitoring, as the existing automated monitoring solutions remain prohibitively expensive. Acoustic monitoring on affordable microcontrollers offers a low-cost, viable solution for automating avian pest detection in smallholder farms across low-income countries. This paper presents Enhanced MicroDSC (Microcontroller Depthwise Separable Convolution), an optimized depthwise separable convolution architecture for acoustic pest bird detection on low-cost microcontrollers. Audio data used to train the model were collected across three regions of Rwanda (Bugesera, Busogo, and Nyagatare) from grain crop farms cultivating maize, wheat, and rice. Recording sessions captured natural behavioral contexts across varied environmental conditions, seasons, and times of day to ensure representative real acoustic complexity and diversity. A dataset comprising 9,970 audio samples (1.5–5 seconds duration) representing 11 classes—eight pest species, two beneficial species, and one non-bird category—was constructed. The mel-frequency energy (MFE) feature was extracted and fed into the compared machine learning models. Rigorous evaluation of Enhanced MicroDSC across 10 independent training runs demonstrated the performance of 97.4% ± 2.3% accuracy, 97.5% ± 2.3% precision, 97.4% ± 2.3% recall, and 97.4% ± 1.5% F1-score. The model comprises 7,483 parameters, representing 97.6% and 99.9% reductions compared to standard DSC and traditional CNN architectures, respectively, and 494× fewer parameters than state-of-the-art models such as YAMNet (3.7M parameters). Practical feasibility was validated through deployment on a Seeed XIAO ESP32S3 microcontroller, demonstrating real-time inference capability with minimal resources. The proposed system offers an economically viable solution for automated pest detection in smallholder grain crop production systems, where avian pests pose critical threats to food security.