Fruit crops such as apple, grape, and tomato suffer significant yield loss every year due to leaf diseases that are usually identified by manual visual inspection, a process that is slow, subjective, and depends heavily on the availability of trained agronomists.
This paper presents a machine-learning-based system that classifies fruit leaf images into healthy and diseased categories directly from RGB leaf photographs. Leaf images from three fruit crops (apple, grape, and tomato), covering twelve disease and healthy classes, are collected from the public PlantVillage repository. Each image is resized, normalized, and passed through a preprocessing pipeline before two parallel classification routes are evaluated: (i) classical machine learning models — Logistic Regression, Decision Tree, K-Nearest Neighbors (KNN), Support Vector Machine (SVM), and Random Forest — trained on handcrafted color, texture (GLCM), and shape (HOG) features, and (ii) a lightweight convolutional neural network built by fine-tuning MobileNetV2 through transfer learning. On a held-out test set of 2,560 images, the proposed transfer-learning model achieves the highest illustrative accuracy of 96.3%, outperforming the best classical model (Random Forest, 92.1%) by 4.2 percentage points. The results indicate that a lightweight transfer-learning model offers a practical balance between accuracy and computational cost for on-field, low-resource disease screening in fruit orchards.
Introduction
The text presents a fruit plant disease detection system based on machine learning and deep learning. The goal is to identify diseases in apple, grape, and tomato leaves at an early stage so that farmers can take timely action, reduce crop losses, and avoid unnecessary pesticide use.
Traditional disease detection depends on farmers or agricultural experts visually inspecting leaves. This approach can be slow, requires expertise, and may lead to errors because different diseases can have similar symptoms. The proposed approach uses digital images of leaves and automated classification, making disease detection faster, more consistent, and potentially suitable for smartphones and low-resource environments.
Motivation and Problem Statement
Most existing studies focus on one crop or one type of machine-learning model. This makes it difficult to directly compare traditional machine learning with modern deep learning under the same conditions. The proposed research addresses this gap by developing a single pipeline for three fruit crops and comparing multiple classical machine-learning algorithms with a lightweight deep-learning model.
Main Contributions
The study makes three major contributions:
Develops a common image preprocessing and feature-extraction pipeline for both classical machine learning and deep learning.
Compares five classical machine-learning models with a MobileNetV2 transfer-learning model across 12 healthy/disease classes covering apple, grape, and tomato.
Performs detailed class-level error analysis using tools such as a confusion matrix to identify commonly confused diseases.
Related Work
Earlier plant-disease detection systems primarily used image-processing techniques such as color thresholding, K-means segmentation, and handcrafted color and texture features. Classifiers such as SVM, Random Forest, and KNN were, VGG16, ResNet, and DenseNet achieved very high accuracy on the PlantVillage dataset. However, these results are often obtained under controlled laboratory conditions and may decrease in real-world field environments because of then used to identify diseases.
Deep learning, particularly Convolutional Neural Networks (CNNs), significantly improved classification performance. Previous studies using architectures such as GoogLeNet, VGG16, ResNet, and DenseNet achieved very high accuracy on the PlantVillage dataset. However, these results are often obtained under controlled laboratory conditions and may decrease in real-world field environments because of changing lighting and complex backgrounds.
This motivates the use of lightweight transfer-learning models such as MobileNetV2, which require fewer computational resources and are more appropriate for mobile or embedded applications.
Methodology
The proposed system follows two parallel classification approaches:
The dataset is obtained from the PlantVillage repository and includes three crops:
Apple
Grape
Tomato
Each crop contains one healthy class and three disease classes, producing 12 classes in total.
Image Processing
Images are first checked for corruption and duplicates and converted into RGB format. They are resized to:
128 × 128 pixels for classical machine-learning models.
224 × 224 pixels for MobileNetV2.
Pixel values are normalized to the [0, 1] range using min-max normalization.
Feature Extraction
The classical machine-learning pipeline uses three types of handcrafted features:
Color features: mean and standard deviation from HSV channels.
Texture features: GLCM-based contrast, correlation, energy, and homogeneity.
Shape features: Histogram of Oriented Gradients (HOG).
These features are combined into a single feature vector and supplied to the classifiers.
MobileNetV2 does not require manually designed features. Instead, its convolutional layers automatically learn useful visual representations from the leaf images.
Models Used
The study evaluates five classical algorithms:
Logistic Regression
Decision Tree
K-Nearest Neighbors (KNN, k=5)
Support Vector Machine (SVM with RBF kernel)
Random Forest with 100 trees
The deep-learning approach uses MobileNetV2, pretrained on ImageNet and fine-tuned for the 12 target classes.
Training
The dataset is divided into 80% training and 20% testing, with stratification to preserve class proportions. MobileNetV2 is fine-tuned for 30 epochs using:
Adam optimizer
Learning rate: 10−4
Batch size: 32
Categorical cross-entropy loss
Horizontal flipping and ±15° rotation for training augmentation
Performance Evaluation
The models are evaluated using:
Accuracy – overall proportion of correctly classified samples.
Precision – proportion of predicted positives that are correct.
Recall – proportion of actual positives correctly detected.
F1-score – balance between precision and recall.
These metrics are calculated using macro-averaging across all 12 classes, ensuring that each disease/healthy class contributes equally to the evaluation.
Conclusion
This paper presented a machine-learning-based system for detecting diseases in apple, grape, and tomato leaves from RGB images. Leaf images from the public PlantVillage dataset, covering twelve disease and healthy classes, were preprocessed and classified using five classical machine learning models and a lightweight MobileNetV2 transfer-learning model. On a held-out set of 2,560 test images, the proposed transfer-learning model achieved the highest illustrative accuracy of 96.3%, outperforming the best classical model, Random Forest, by 4.2 percentage points, while remaining light enough for on-field, mobile deployment. These results suggest that a lightweight transfer-learning approach offers a practical balance between accuracy and computational cost for fruit plant disease screening.
References
[1] S. P. Mohanty, D. P. Hughes, and M. Salathé, \"Using deep learning for image-based plant disease detection,\" Frontiers in Plant Science, vol. 7, art. 1419, 2016.
[2] E. C. Too, L. Yujian, S. Njuki, and L. Yingchun, \"A comparative study of fine-tuning deep learning models for plant disease identification,\" Computers and Electronics in Agriculture, vol. 161, pp. 272-279, 2019.
[3] P. B. Padol and A. A. Yadav, \"SVM classifier based grape leaf disease detection,\" 2016 Conference on Advances in Signal Processing (CASP), Pune, India, 2016, pp. 175-179.
[4] D. P. Hughes and M. Salathé, \"An open access repository of images on plant health to enable the development of mobile disease diagnostics,\" arXiv:1511.08060, 2015.
[5] C. Cortes and V. Vapnik, \"Support-vector networks,\" Machine Learning, vol. 20, no. 3, pp. 273-297, 1995.
[6] L. Breiman, \"Random forests,\" Machine Learning, vol. 45, no. 1, pp. 5-32, 2001.
[7] K. Simonyan and A. Zisserman, \"Very deep convolutional networks for large-scale image recognition,\" arXiv:1409.1556, 2014.
[8] K. He, X. Zhang, S. Ren, and J. Sun, \"Deep residual learning for image recognition,\" in Proc. IEEE Conf. Computer Vision and Pattern Recognition (CVPR), 2016, pp. 770-778.
[9] M. Sandler, A. Howard, M. Zhu, A. Zhmoginov, and L.-C. Chen, \"MobileNetV2: Inverted residuals and linear bottlenecks,\" in Proc. IEEE Conf. Computer Vision and Pattern Recognition (CVPR), 2018, pp. 4510-4520.
[10] P. K. Sethy, N. K. Barpanda, A. K. Rath, and S. K. Behera, \"Deep feature based rice leaf disease identification using support vector machine,\" Computers and Electronics in Agriculture, vol. 175, art. 105527, 2020.
[11] Y. LeCun, Y. Bengio, and G. Hinton, \"Deep learning,\" Nature, vol. 521, no. 7553, pp. 436-444, 2015.