Data
The dataset is PlantVillage, in the version with the background removed: 54,306 leaf photos in 38 classes, each one a species paired with a disease, or the healthy leaf. There are 14 species; tomato alone has 10 classes.
Tomato
Healthy
Early blight
Late blight
Septoria leaf spot
Yellow leaf curl
Mosaic virus
Healthy
Early blight
Late blight
Septoria leaf spot
Yellow leaf curl
Mosaic virusOther species
Apple · healthy
Apple · scab
Grape · esca
Corn · common rust
Orange · greening
Potato · late blight
Apple · healthy
Apple · scab
Grape · esca
Corn · common rust
Orange · greening
Potato · late blightThe classes are imbalanced, ranging from 152 images (healthy potato) to 5,507 (orange with greening). I split 80% for training and 20% for validation, and sampled training images with weights inversely proportional to class frequency.
What I did
- Transfer learning by fine-tuning pretrained CNN backbones in PyTorch to classify multiple leaf diseases.
- Preprocessing and data augmentation pipelines with NumPy and PyTorch DataLoaders.
- Adapted the classification head and tuned hyperparameters to improve generalization and control overfitting.
Result
95% accuracy on the validation set.
Stack
PyTorch · NumPy · CNN · Transfer learning