A deep learning system that detects and classifies 38 plant disease categories from leaf images. Built with EfficientNetB0 transfer learning and deployed as a Gradio web app.
Upload a photo of a plant leaf → get an instant diagnosis with disease description, severity, and treatment advice.
| Model | EfficientNetB0 (fine-tuned, two-phase) |
| Dataset | PlantVillage — 54,305 images |
| Classes | 38 across 14 crop species |
| Expected accuracy | 93–97% on validation set |
| Input size | 224 × 224 RGB |
| Confidence threshold | 50% — low-confidence predictions rejected |
Apple (scab, black rot, cedar rust, healthy) · Blueberry · Cherry (powdery mildew) · Corn (cercospora, common rust, northern leaf blight) · Grape (black rot, esca, leaf blight) · Orange (citrus greening) · Peach (bacterial spot) · Bell Pepper (bacterial spot) · Potato (early blight, late blight) · Raspberry · Soybean · Squash (powdery mildew) · Strawberry (leaf scorch) · Tomato (bacterial spot, early blight, late blight, leaf mold, septoria, spider mites, target spot, yellow leaf curl virus, mosaic virus)
git clone https://github.com/Sowaiba-01/AgroVision-Net.git
cd AgroVision-Net
pip install -r requirements.txtDownload PlantVillage from Kaggle and extract so the structure is:
data/
└── PlantVillage/
├── Apple___Apple_scab/
├── Apple___healthy/
├── Tomato___Late_blight/
└── ...
# Linux / Mac
export DATA_DIR="data/PlantVillage"
python -m src.train
# Windows
set DATA_DIR=data/PlantVillage
python -m src.trainTraining runs in two phases automatically:
- Phase 1 (up to 15 epochs): classification head only, backbone frozen, LR = 1e-3
- Phase 2 (up to 10 epochs): top 20 EfficientNetB0 layers unfrozen, LR = 1e-5
Saves models/best_model.keras and models/class_names.json.
python app.pyOpen http://localhost:7860 in your browser.
python -m src.predict --image path/to/leaf.jpgTests use mocked models — no GPU, no trained model, no internet required.
# Run all tests
pytest tests/ -v
# With coverage report
pytest tests/ -v --cov=src --cov-report=term-missing| Model | EfficientNetB0 via TensorFlow/Keras |
| UI | Gradio |
| Image processing | Pillow, NumPy |
| Testing | pytest, pytest-cov |
| CI | GitHub Actions |
MIT — see LICENSE.