Hardware-Aware YOLO Compression for Low-Power Edge AI on STM32U5 for Weeds Detection in Digital Agriculture
Charalampos S. Kouzinopoulos, Yuri Manna
TL;DR
This paper addresses weed detection in digital agriculture by enabling real-time, low-power edge inference on a STM32U575ZI MCU using a compressed YOLOv8n detector. Through structured pruning (70%), per-channel 8-bit quantization, and input-size reduction to 224×224, the model fits within 2 MB Flash and 768 KB RAM, achieving map50 0.517 and map50-95 0.403 while delivering 51.8 mJ per inference at ~0.66 fps. The approach uses an end-to-end deployment pipeline with STM32Cube.AI, calibrated quantization, and careful scheduling to realize energy-efficient in-situ weed detection for power-constrained fields. The results demonstrate a practical accuracy-energy trade-off suitable for scalable deployment in digital agriculture and highlight directions for further optimization and hardware acceleration.
Abstract
Weeds significantly reduce crop yields worldwide and pose major challenges to sustainable agriculture. Traditional weed management methods, primarily relying on chemical herbicides, risk environmental contamination and lead to the emergence of herbicide-resistant species. Precision weeding, leveraging computer vision and machine learning methods, offers a promising eco-friendly alternative but is often limited by reliance on high-power computational platforms. This work presents an optimized, low-power edge AI system for weeds detection based on the YOLOv8n object detector deployed on the STM32U575ZI microcontroller. Several compression techniques are applied to the detection model, including structured pruning, integer quantization and input image resolution scaling in order to meet strict hardware constraints. The model is trained and evaluated on the CropAndWeed dataset with 74 plant species, achieving a balanced trade-off between detection accuracy and efficiency. Our system supports real-time, in-situ weeds detection with a minimal energy consumption of 51.8mJ per inference, enabling scalable deployment in power-constrained agricultural environments.
