Visual Intelligence & Deep Learning Dec 5, 2025 Published project
Cashew Leaf Disease Classification

Agricultural image classification with transfer learning

This project develops a visual-classification workflow for identifying cashew leaf conditions across healthy and diseased categories. It compares multiple pretrained CNN architectures, uses class weighting and augmentation, and evaluates performance with class-level metrics.

PythonPyTorchtimmEfficientNet-B0ResNet-18VGG-16DenseNet-121

Challenge

  • Leaf disease diagnosis can be slow, subjective, and inconsistent when performed manually.
  • The dataset is moderately imbalanced, with the Gummosis class much smaller than the other categories.
  • A strong result needs class-level evaluation, not only overall accuracy.

System architecture

Leaf images5 health/disease classes
Data preparationsplits + augmentation
CNN modelsEfficientNet · ResNet · VGG · DenseNet
Evaluationaccuracy and macro F1

Data and inputs

  • 6,549 images from the CCMT Cashew subset.
  • Five categories: Anthracnose, Gummosis, Leaf Miner, Red Rust, and Healthy.
  • 70/15/15 train-validation-test split with 224 × 224 inputs.

Technical approach

  • Apply stratified splitting to preserve class proportions across train, validation, and test sets.
  • Resize and normalize images using ImageNet statistics.
  • Use augmentation including random resized crop, horizontal flip, and color jitter.
  • Compare EfficientNet-B0, ResNet-18, VGG-16, and DenseNet-121 using weighted cross-entropy and early stopping.

Evaluation and results

Key indicators

6,549 leaf images

Key indicators

5 disease/health classes

Key indicators

EfficientNet-B0 accuracy 98.58%

  • EfficientNet-B0 with learning rate 3e-4 achieved 98.58% test accuracy and 98.80% macro F1-score.
  • EfficientNet-B0 with learning rate 1e-4 also performed strongly with 98.37% test accuracy.
  • ResNet-18 and DenseNet-121 were competitive but below the best EfficientNet-B0 run.
  • Remaining errors were mainly between visually similar disease categories such as Anthracnose and Leaf Miner.

Implementation and code

Implementation focus

The implementation connects data preparation, modeling, evaluation, and interpretation in a structured workflow that makes the technical decisions clear.

Source code

The code is available for exploring the implementation details and extending the experiment when needed.

Open source code

Scope and responsible use

The project is a focused modeling and evaluation study. Broader use should be supported by validation on additional data, robustness checks, monitoring, and domain-specific evaluation.

Future development

  • Add Grad-CAM or similar explainability methods.
  • Evaluate MixUp, CutMix, and mobile-friendly architectures.
  • Test the workflow on field images from different farms, devices, and lighting conditions.

Technical contribution

The project demonstrates how to evaluate visual AI under class imbalance, compare architectures fairly, and interpret disease-classification performance beyond one headline metric.