maize-disease-model / README.md
moro23's picture
Upload README.md with huggingface_hub
b05a7bc verified
|
Raw
History Blame Contribute Delete
1.59 kB
metadata
language: en
license: mit
tags:
  - image-classification
  - plant-disease
  - agriculture
  - efficientnet
  - transfer-learning
  - maize
  - ghana
metrics:
  - accuracy
  - f1

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