Maize Disease & Pest Classifier β€” EfficientNet-B0

Part of the MSc thesis: "Application of Deep Learning for Low-Resource Maize Disease Diagnosis in Heterogeneous Agro-Ecological Zones"

Model details

Architecture EfficientNet-B0
Training strategy Two-phase transfer learning (ImageNet β†’ maize diseases)
Test accuracy 90.94%
Weighted F1 0.9198 (validation)
Classes 7
Input size 224 Γ— 224

Classes

  1. Healthy
  2. Northern Leaf Blight
  3. Common Rust
  4. Gray Leaf Spot
  5. Ear Rot
  6. Fall Armyworm
  7. Stem Borer

Dataset

Combined from:

  • PlantVillage (4,188 images, 4 classes) β€” Kaggle
  • Ghana field images (406 images, 3 classes) β€” custom field-collected dataset

Total: 4,594 images | Class imbalance: 10.75:1

Usage

from huggingface_hub import hf_hub_download
import torch
from src.deployment.inference import MaizeClassifier
from PIL import Image

ckpt = hf_hub_download(repo_id="moro23/maize-disease-model",
                       filename="best_val_weighted_f1_0.919762_epoch_22.pth")
classifier = MaizeClassifier(ckpt, "configs/data_config.yaml")
image = Image.open("maize_leaf.jpg")
print(classifier.predict(image))

Deployment

Live demo: HuggingFace Spaces

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support