A TinyMLOps Pipeline for Coarse-Grained Plant Disease Classification in Precision Agriculture
Hossein Aqasizade, Mattia Antonini, Massimo Vecchio, Fabio AntonelliIdentifying plant health conditions is an emerging precision-agriculture and food-security challenge, intensified by deploying deep-learning models on memory- and power-constrained edge devices. We present a TinyMLOps pipeline spanning model design, optimization, quantization, and deployment across diverse edge devices, evaluated under controlled laboratory conditions. Using a dataset derived from the PlantVillage benchmark, 39 fine-grained classes are aggregated into three superclasses: healthy leaf, unhealthy leaf, and no leaves. The resulting system therefore performs plant health-status classification and background filtering rather than diagnosing specific diseases. We train a MobileNet-based convolutional neural network jointly optimized for classification accuracy and computational efficiency, adopting state-of-the-art hyperparameter optimization (HPO) tools. Five models are selected, four from the Pareto Front and one as the biggest evaluated model during HPO, converted to LiteRT and ONNX, and evaluated at float32 and post-training int8 precision on a Raspberry Pi Zero 2 W and an STM32H743ZI microcontroller. At float32, LiteRT is 1.87–2.65× faster than ONNX Runtime on the Raspberry Pi across all five models. Relative to their float32 LiteRT counterparts, the int8 LiteRT models are 2.83–3.67× smaller on disk and 21.3–31.2% faster on the same board, at a cost in F1-score of between 0.0010 and 0.0068. On the microcontroller, only the two smallest models deploy at both precisions; for these, the fully quantized int8 variants are 4.3× faster and 3.85× smaller in MCU flash footprint than the float32 counterparts. The mid-range model fits the 2 MB flash and 1 MB RAM budget only when quantized, while the two largest models exceed it in every configuration tested.