Attention-enhanced YOLOv8n-CLS for lightweight and efficient tomato leaf disease classification
Abstract
Introduction Tomato leaf diseases substantially reduce crop yield and fruit quality, creating a need for accurate, computationally efficient, and potentially deployable image-based disease-screening systems for precision agriculture. This study presents an Attention-Enhanced YOLOv8n-CLS framework for tomato leaf disease classification by integrating a lightweight spatial attention mechanism to enhance the representation of spatially informative image features while maintaining a compact computational structure. Methods Unlike conventional object detection approaches that require bounding-box annotations, the proposed framework formulates disease recognition as an image-level classification task, requiring only class labels and thereby simplifying dataset preparation and model training. Experiments were conducted on two publicly available benchmark datasets, namely the PlantVillage Tomato Dataset and the Kaggle Tomato Leaf Disease Dataset. A systematic evaluation comprising binary and multiclass classification, five-fold cross-validation, ablation analysis, cross-dataset evaluation, comparative benchmarking, computational assessment, and Grad-CAM-based visualization was performed to assess classification performance, stability, transferability, and computational efficiency. Results The Attention-Enhanced YOLOv8n-CLS achieved a maximum classification Accuracy of 98.90%, an AUC of 0.991, a computational complexity of 7.5 GFLOPs, and an average inference speed of approximately 45 FPS on the evaluated computing platform. In five-fold cross-validation, the proposed model achieved a mean Accuracy of 98.50% ± 0.14% on the PlantVillage Tomato Dataset and 97.82% ± 0.29% on the Kaggle Tomato Leaf Disease Dataset. The model also demonstrated competitive performance relative to representative deep learning architectures, including ResNet50, DenseNet201, ResNet152V2, MobileNetV2, and YOLOv5. The cross-dataset experiments further demonstrated transferability between the evaluated PlantVillage and Kaggle image distributions using the 10 classes shared by the two datasets. Discussion The results indicate a favourable balance between classification performance and computational requirements under the evaluated experimental conditions, with potential for further investigation in resource-constrained applications. Grad-CAM visualization provided qualitative information about image regions associated with the model's classification decisions but did not independently establish biological causality or pathogen-specific recognition. Importantly, the proposed framework performs image-based symptom classification and preliminary disease screening using dataset-provided labels; it does not independently confirm causal pathogens. Therefore, the reported classification performance should not be interpreted as definitive pathogen diagnosis or field-level validation. Further evaluation using independently collected field images, laboratory-confirmed disease or pathogen status, diverse symptom presentations, and representative agricultural edge devices is required before practical agricultural deployment can be established.