All Projects
Computer Vision

Plant Disease Classification

15-class PlantVillage benchmark. MobileNetV2 individual best: 92.86%. Ensemble (MobileNetV2+EfficientNetB3+ResNet50) test: 83.43%. 42.5× class imbalance. Fixed generator-reset bug that caused ensemble collapse.

92.86%
MobileNetV2 Val Acc
83.43%
Ensemble Test Acc
87.72%
ResNet50 Val Acc
70.01%
SimpleCNN Val Acc
Dataset

PlantVillage: ~55K images, 15 classes, 42.5× imbalance

Approach

2-phase TL (warmup + fine-tune) → soft ensemble with class-weighted loss

Tech Stack
PythonTensorFlow 2.19MobileNetV2EfficientNetB3ResNet50Keras
Keywords
MobileNetV2EfficientNetB3ResNet50EnsembleAgricultureTransfer Learning
Visualizations6 Charts
Deep Dive

Plant disease detection on PlantVillage — 15 disease classes across pepper and potato plants.

Dataset

  • ~55,000 images, 15 classes, 80/10/10 train/val/test split
  • Class imbalance: 42.5× (Tomato_YellowLeafCurlVirus vs Potato_healthy)
  • Imbalance strategy: class weights + label smoothing 0.1

All 6 Models

ModelVal Accuracy
SimpleCNN70.01%
DeepCNN + BatchNorm78.41%
EfficientNetB3 (2-phase TL)79.93%
ResNet50 (2-phase TL)87.72%
MobileNetV2 (2-phase TL)92.86%
Ensemble (3 TL avg)82.40% val / 83.43% test

2-Phase Transfer Learning

  1. Warmup (8 epochs): frozen backbone
  2. Fine-tune (3 epochs): CosineDecayRestarts LR, mixed precision float16

Bug Fixed: Generator Reset The ensemble collapsed to ~7% accuracy (random chance) because data generators were not reset between inference passes. Each generator remembered its last position, returning misaligned batches to each model. Fix: re-initialize generators before each model's predict() call.

Why Ensemble < MobileNetV2? Soft averaging MobileNetV2 (92.86%) with EfficientNetB3 (79.93%) dilutes MobileNetV2's superior predictions. The ensemble provides better test generalization (83.43%) but lower val accuracy.