Abstract
Early detection of foliar diseases in potato crops remains challenging in real-world agricultural settings because symptoms can be similar and field images present challenges (weather, illumination, orientation, scale, blur, etc.). Although deep learning models have shown promising results in leaf disease detection in agricultural images, comparisons between modern lightweight convolutional neural network (CNN) architectures and attention-based mechanisms (Transformers) for potato crops remain limited, especially for local inference on edge computing devices. This study experimentally compares lightweight YOLO26 (CNN-based) and RT-DETRv2 (Transformer-based) object detectors under a common training and evaluation protocol for leaf-level detection and classification of four potato leaf classes: Healthy leaf, Early blight, Late blight, and Septoria leaf spot. These diseases exhibit noticeable symptoms in the foliage, distinguishable in the visible spectrum. These conditions generate irregular and asymmetric visual patterns on the leaf surface, making them difficult to detect under varying lighting and environmental conditions. The models were trained on the PyTorch framework using the CRISP-DM methodology on a hybrid dataset of 3060 RGB images, consisting of 2152 public images from the PlantVillage dataset and 908 custom images collected from agricultural plots in the Carchi province of Ecuador. The images were annotated with leaf-level bounding boxes using the Roboflow software. The task was formulated as leaf-level disease detection, where each bounding box represents a complete leaf assigned to a single diagnostic class. Among the evaluated configurations, YOLO26n provided the most favorable observed balance between predictive performance and computational efficiency, achieving 98.89% mAP50, 98.05% mAP50-95, 96.99% precision, and 95.76% recall, with a GPU inference time of 5.06 ms. The evaluated RT-DETRv2 configurations achieved competitive detection performance but required greater computational resources and higher inference latency. The YOLO26n model turned out to be comparable to some existing works and was therefore exported to TensorFlow Lite and integrated into a mobile application called CultivoScan, published on the Google Play Store. The application performs inference locally on Android devices, without relying on an external server, making it suitable as technological support for the visual identification of foliar diseases in potato crops in real-world agricultural contexts.