Source-linked AI summary

Less is More: Lighter and Faster Deep Neural Architecture for Tomato Leaf Disease Classification

Sabbir Ahmed, Md. Bakhtiar Hasan, Tasnim Ahmed, Redwan Karim Sony, Md. Hasanul Kabir

arXiv:2109.02394v2cs.CVcs.LG

TL;DR

Tomato disease classification needs fast, accurate, computationally inexpensive systems suitable for low-end devices. The paper combines illumination correction, runtime augmentation, pretrained MobileNetV2 features, and a classifier network, achieving 99.30% accuracy while maintaining a relatively small computational footprint.

  • Problem

    Low-end agricultural devices need fast, accurate, computationally inexpensive disease-classification systems, while existing lightweight approaches may sacrifice accuracy or cover limited diseases and samples.

  • Method

    The approach enhances leaf images with CLAHE, extracts features using pretrained MobileNetV2, and applies runtime augmentation with a classifier network to address imbalance and avoid data leakage.

  • Results

    99.30% accuracy was achieved on PlantVillage images covering healthy leaves and nine disease classes, with lower model size and computation than comparable state-of-the-art models.

  • Takeaways & Limitations

    The proposed pipeline is presented as a suitable choice for building tomato disease-classification applications on low-end devices.

  • Takeaways & Limitations

    PlantVillage samples were collected under laboratory conditions, and each sample contains only a single disease.

Abstract

from arXiv · show

To ensure global food security and the overall profit of stakeholders, the importance of correctly detecting and classifying plant diseases is paramount. In this connection, the emergence of deep learning-based image classification has introduced a substantial number of solutions. However, the applicability of these solutions in low-end devices requires fast, accurate, and computationally inexpensive systems. This work proposes a lightweight transfer learning-based approach for detecting diseases from tomato leaves. It utilizes an effective preprocessing method to enhance the leaf images with illumination correction for improved classification. Our system extracts features using a combined model consisting of a pretrained MobileNetV2 architecture and a classifier network for effective prediction. Traditional augmentation approaches are replaced by runtime augmentation to avoid data leakage and address the class imbalance issue. Evaluation on tomato leaf images from the PlantVillage dataset shows that the proposed architecture achieves 99.30% accuracy with a model size of 9.60MB and 4.87M floating-point operations, making it a suitable choice for real-life applications in low-end devices. Our codes and models are available at https://github.com/redwankarimsony/project-tomato.

I. INTRODUCTION

Tomato disease classification needs accurate, reliable, and computationally efficient methods suitable for low-end agricultural devices. The proposed system combines transfer learning, illumination correction, and runtime augmentation to achieve high accuracy with reduced computational demands.

  • Manual tomato disease detection can be inefficient and unreliable, especially where farmers lack professional knowledge or access to agricultural experts.
  • Deep learning and transfer learning reduce reliance on handcrafted features and computational resources for plant disease classification.
  • The proposed architecture uses pretrained MobileNetV2 for feature extraction followed by a classifier network, with CLAHE enhancing disease spots under poor lighting.
  • The proposed system targets low-end devices by maintaining high accuracy with a smaller model and fewer computations than comparable state-of-the-art models.
  • 97.27% baseline accuracy increased to 99.30% with the proposed pipeline on healthy and nine diseased tomato-leaf classes from PlantVillage.

III. MATERIALS AND METHODS

The methodology uses PlantVillage tomato-leaf data, preprocessing, transfer learning, and runtime augmentation to address illumination variation, class imbalance, and data leakage. These choices support classification across ten tomato classes while preserving challenging image information.

  • III. MATERIALS AND METHODS: The system preprocesses tomato-leaf images with adaptive histogram equalization before transfer-learning feature extraction and class-label prediction.Nine pretrained architectures were evaluated as candidate feature extractors, including MobileNetV2.
  • A. DATASET: PlantVillage contains 18,160 tomato images divided into one healthy and nine disease classes, with labels produced by plant pathology experts.
  • A. DATASET: The dataset is imbalanced, ranging from 5,357 Yellow Leaf Curl Virus images to 373 Mosaic Virus images.
  • B. DATA PREPROCESSING: Poor lighting can make disease spots similar in intensity to their surroundings, reducing the visual details available for classification.Histogram-based contrast enhancement is used to improve leaf details and correct illumination differences.
  • B. DATA PREPROCESSING: Runtime augmentation is applied after dataset splitting to address imbalance while avoiding leakage from augmented training images into validation or test sets.Pre-split augmentation can overestimate accuracy because related image variations may appear across different splits.

1) Contrast Limited Adaptive Histogram Equalization (CLAHE)

The method enhances tomato leaf images with CLAHE and applies randomized runtime augmentations across dataset splits to improve robustness while avoiding repeated image versions and leakage.

  • Contrast enhancement: CLAHE enhances contrast between diseased spots and leaves by processing multiple local regions while limiting noise amplification.The method converts images to Hunter Lab, divides intensity channels into contextual regions, clips histograms, and interpolates neighboring regions.
  • Contrast enhancement: All tomato leaf images are preprocessed with CLAHE before entering the model.
  • Data augmentation: Runtime augmentation randomly applies shifting, rotation, shearing, and horizontal flipping to reflect real-life image variation.
  • Data augmentation: Multiple random augmentations create a new image variation each epoch during training, validation, and testing.
  • Data augmentation: Applying augmentations separately across splits reduces overfitting and prevents different versions of the same image from appearing in both training and test sets.

C. TRANSFER LEARNING-BASED FEATURE EXTRACTOR

The feature extractor uses pretrained MobileNetV2 components and a custom classifier network to generate disease predictions from tomato leaf images with reduced computation.

  • Transfer learning: MobileNetV2 transfers pretrained feature-extraction capability to tomato disease classification by replacing its original classification layer with a custom classifier network.
  • MobileNetV2 architecture: The MobileNetV2 backbone contains an initial convolution, 17 bottleneck residual blocks, pointwise convolution, global average pooling, and classification stages.
  • Bottleneck residual blocks: Depthwise separable convolution reduces computation by O(k^2) compared with regular convolution in the bottleneck residual blocks.
  • Model comparison: The study compares MobileNetV2 with eight other pretrained architectures used in leaf disease detection.
  • Classifier network: The classifier further processes MobileNetV2 features through dense, dropout, and batch-normalization blocks, using dense layers with 128 and 64 nodes.

E. EXPERIMENTAL SETUP

The experiments use stratified dataset splitting, mini-batch training, shuffling, early stopping, adaptive optimization, pretrained initialization, and test-set accuracy evaluation.

  • Data partitioning: Images from each class are randomly divided into 60% training, 20% validation, and 20% test subsets.
  • Optimization: Training uses mini-batch gradient descent with batch size 16, while images are shuffled after every epoch.
  • Training control: Training runs for at most 1000 epochs with early stopping after ten consecutive patient epochs based on validation accuracy.
  • Training control: The proposed architecture converges after 70 epochs on average.
  • Optimization: Adam optimization uses categorical cross-entropy, an initial learning rate of 10^-5, and reductions by a factor of 0.1 after four patient epochs.
  • Initialization and checkpoints: Feature extractors are initialized with ImageNet pretrained weights, while the classifier network starts with random weights and checkpoints preserve the best validation model.
  • Evaluation: Test-set accuracy measures correctly predicted samples among unseen test examples to estimate generalization.

2) Parameter Count

Parameter count measures a model’s learnable weights and helps characterize training, model size, and inference requirements. Related measures include saved model size and FLOPs Count for comparing computational demands.

  • Parameters are learnable weights updated during backward propagation according to the optimization algorithm.
  • The total parameter count is obtained by summing the parameters across all model layers.In the equation, p_i denotes the parameter count for layer i and L denotes the total number of layers.
  • Saved model size measures the storage occupied by the model and can be reported in megabytes or gigabytes.An HDF5 model stores configuration, trained weights, and optimizer state.
  • FLOPs Count estimates the theoretical floating-point operations required for inference, enabling relative computational comparisons across models.Higher FLOPs Count indicates more computations are required for inference.
  • Macro-average precision averages per-class precision values so imbalanced classes receive equal consideration.For each class, precision is calculated using a one-vs-all strategy from true-positive and false-positive counts.

6) Recall

Recall measures how many samples belonging to a class are correctly identified, while macro averaging gives each class equal influence. F1-score combines precision and recall for imbalanced classification.

  • Recall measures the proportion of samples that should belong to a class that are correctly classified.Recall is also called sensitivity.
  • Per-class recall is calculated using a one-vs-all strategy from true-positive and false-negative counts.TP_c counts samples correctly classified as class c, while FN_c counts samples of class c assigned to other classes.
  • Macro-average recall averages recall across classes so each false-negative instance receives equal consideration.This measure is intended for imbalanced classes.
  • F1-score is the weighted average of precision and recall, incorporating both false-positive and false-negative predictions.The per-class F1-score uses precision and recall for that class.
  • Macro-average F1-score averages per-class F1-scores so every class receives equal priority.This formulation is used for imbalanced classes.

8) AUC-ROC Score

AUC-ROC evaluates class separation by combining true-positive and false-positive behavior across probability thresholds. The ROC curve summarizes these threshold-dependent operating points.

  • AUC-ROC combines the True Positive Rate and False Positive Rate as an evaluation method.
  • ROC analysis calculates TPR and FPR at multiple probability thresholds and links the resulting points into a curve.
  • The ROC framework evaluates how well a model separates classes from one another.A diagonal line from FPR 0 and TPR 0 represents a model with no discriminating power.

IV. RESULT AND DISCUSSION

The experiments compare baseline architectures and systematically test preprocessing, augmentation, and classifier components. The resulting pipeline improves MobileNetV2 performance while targeting accuracy and computational efficiency.

  • Experimental design: The study evaluates baseline CNN architectures, performs ablation experiments, and examines per-class precision, recall, and F1-score.
  • Baseline architectures: Pretrained ImageNet weights were fine-tuned on PlantVillage tomato images, with only the final softmax layer changed for the baseline setup.
  • Baseline architectures: 99.48% accuracy from VGG19 was 2.2% higher than MobileNetV2, but required 8.5 times the storage and 8.8 times the FLOPs.
  • Baseline architectures: MobileNetV2 was selected because it had the smallest model size and lowest FLOPs count among the compared architectures.Its fewer parameters also support faster training and inference, after which preprocessing and an additional classifier network were applied.
  • Ablation study: CLAHE improved baseline accuracy from 97.27% to 97.71%, while runtime augmentation further exposed the model to varied image representations.The authors attribute the CLAHE improvement to making disease spots more prominent.
  • Ablation study: Runtime augmentation was applied across splits, with 100 augmented test runs averaged because random transformations produce variable accuracy values.The authors report that the maximum accuracy of the best model was 99.53%.
  • Ablation study: 99.30% mean accuracy was achieved over 100 runs after preprocessing and classifier-network enhancements, compared with 97.27% for baseline MobileNetV2.The preprocessing combination reached 98.84% before the classifier network was added.

C. ADDRESSING THE CLASS IMBALANCE

The study addresses PlantVillage class imbalance by evaluating macro-averaged metrics and examining discrimination across all ten tomato-leaf classes. The proposed model achieves strong balanced classification performance, including high ROC separability.

  • Macro-averaged precision, recall, and F1-score were used because class imbalance can make accuracy misleading.These metrics give equal importance to all classes.
  • 99.12 F1-score indicates robust classification performance on the imbalanced dataset.The authors relate this value to high precision and recall and fewer accidental false positives and false negatives.
  • Per-class precision, recall, and F1-score remained high even for classes with fewer samples.The authors attribute this result to their data augmentation technique.
  • AUC scores reached 1 for Leaf Mold, Yellow Leaf Curl Virus, and Mosaic Virus.The other classes also achieved fairly high AUC scores, indicating satisfactory class separability.

E. COMPARISON WITH STATE-OF-THE-ART METHODS

The proposed architecture compares favorably with state-of-the-art tomato leaf classifiers by combining high accuracy with lower storage and computation requirements. The analysis also uses GradCAM to inspect whether predictions focus on relevant leaf regions.

  • E. COMPARISON WITH STATE-OF-THE-ART METHODS: 99.30% accuracy was achieved while keeping model size and operation count low compared with state-of-the-art models.Only achieved higher accuracy, by 0.09%, while requiring 2.4 times the model size and 59.27% more FLOPs.
  • E. COMPARISON WITH STATE-OF-THE-ART METHODS: 9.6MB of storage was required, while other similarly accurate works required at least twice as much space.A smaller model,, achieved substantially lower accuracy.
  • E. COMPARISON WITH STATE-OF-THE-ART METHODS: The proposed model significantly reduced FLOPs without compromising accuracy, lowering hardware requirements and inference time.The comparison is presented as accuracy versus FLOPs count.
  • E. COMPARISON WITH STATE-OF-THE-ART METHODS: GradCAM was used to determine whether correctly classified samples were predicted using relevant image features.The visualization highlights the regions receiving attention during class-label decisions.
  • E. COMPARISON WITH STATE-OF-THE-ART METHODS: For diseased samples, the model focused on diseased leaf regions, while for healthy leaves it examined the entire leaf.These qualitative results indicate different attention patterns for diseased and healthy samples.

2) Error Analysis

Error analysis shows strong performance across many classes but identifies Early Blight as the main source of misclassification. The errors are linked to visually similar disease patterns, damaged leaves, and dataset conditions that limit broader deployment.

  • 2) Error Analysis: Half of the classes were predicted correctly for every unseen test sample, while the remaining classes had accuracy comparable to other state-of-the-art methods.The confusion matrix covers ten tomato-leaf classes.
  • 2) Error Analysis: Early Blight produced the most misclassified samples, with some cases predicted as Late Blight.The authors found visually similar leaves between these classes.
  • 2) Error Analysis: Similar Late Blight images in the training set provide a direct explanation for some Early Blight-to-Late Blight errors.The model learned to assign similar training images to Late Blight, making similar test predictions expected.
  • 2) Error Analysis: Inter-class similarities in infected regions and severe viral damage restricted meaningful feature extraction and led to misclassification.These factors complicate disease discrimination even when attention is directed toward diseased regions.
  • 2) Error Analysis: The evaluation uses laboratory-condition images, while field images may introduce varying backgrounds, occlusion, and background clutter.The authors also identify multi-disease leaves and infection-severity recognition as future challenges.
Loading 2109.02394v2…