MAF-YOLOv8: A lightweight, high-precision deep learning model applied to real-time detection and counting of Betula luminifera seedling leaves
Tianhao Guo, Yumeng Peng, Lixin Han, Tianze Jia, Chang Zhang, Wei Liu, Qinghua Yang, Huahong Huang, Dong Hu
Abstract
Leaf detection and counting are essential in plant phenotyping, but traditional manual methods are slow and error prone. To improve the efficiency and accuracy of leaf counting, this study introduces a lightweight, high-precision model for leaf detection and counting based on the optimized YOLOv8 computer vision model, called MobileViT-Asymptotic Feature Pyramid Network-YOLOv8 (MAF-YOLOv8). This model integrates the MobileViT architecture and an Adaptive Feature Pyramid Network (AFPN) structure, achieving a lightweight model with enhanced feature representation capabilities, thereby improving leaf counting accuracy. In this work, we constructed a dataset consisting of 711 RGB images with a 640 × 640 resolution and expanded it to 2136 images using data augmentation methods to enhance model robustness. The MAF-YOLOv8 model was able to achieve a mean average precision (mAP) of 91.7 %, a recall of 95.0 %, and a precision of 86.5 % in leaf counting tasks. Compared to YOLOv8, mAP improved by 2.6 %, while the number of parameters was reduced by 34.1 %. Ablation experiments evaluating the contributions of each model component further confirmed that MobileViT and AFPN critically improve model performance; together, they led to a 2.3 % improvement in precision and a 3 % increase in recall. This study also validates the performance of MAF-YOLOv8 on resource-constrained mobile devices, achieving an inference time of only 5.110 s. The findings indicate that the model has superior accuracy, inference speed, and resource efficiency, which renders it suitable for extensive applications within agriculture and environmental monitoring. This study provides an efficient technological approach for plant phenotyping and precision agriculture. • Replaced YOLOv8's backbone with MobileViT to reduce model size. • Integrated the Asymptotic Feature Pyramid Network to improve model accuracy. • The robustness of MAF-YOLOv8 is validated using a multi-environment dataset. • MAF-YOLOv8 demonstrates efficient performance when deployed on Raspberry Pi.