KrishiAI MobileNetV3 Plant Disease & Foliar Health Classifier
Trained lightweight transfer learning model for foliar plant disease classification across 17 target classes in Tomato, Potato, and Corn (Maize).
Integrated as the primary visual screening backbone in the KrishiAI Multi-Agent Farmer Advisory System.
Model Summary
- Architecture:
mobilenet_v3_small(1.54M parameters, 5.98 MB) - Pretrained Backbone: ImageNet-1K (
torchvision.models.MobileNet_V3_Small_Weights.DEFAULT) - Input Dimensions: 224 × 224 pixels, RGB
- Normalization: ImageNet Mean
[0.485, 0.456, 0.406], Std[0.229, 0.224, 0.225] - Inference Latency: 4.29 ms on Apple Silicon GPU/MPS; ~12 ms on standard CPU
Evaluation Performance
| Evaluation Split | Metric | Score | Notes |
|---|---|---|---|
| PlantVillage Test (Held-out, N=3,621) | Accuracy | 98.56% | Zero specimen overlap with training |
| Macro-F1 | 0.9805 | Balanced across all 17 classes | |
| Weighted-F1 | 0.9857 | Clean laboratory reference leaves | |
| Confidence-Gated Acc (≥ 0.60) | 98.89% | Rejection rate: 0.88% | |
| PlantDoc External Benchmark (Field, N=1,151) | In-Scope Accuracy | 20.85% | Real-world in-the-wild field imagery |
| In-Scope Macro-F1 | 0.1280 | Unconstrained field domain gap | |
| Out-of-Scope Rejection Rate | 30.73% | Rejects unsupported species |
Supported Classes (17 Target Categories)
- Corn (Maize) — Gray Leaf Spot (Cercospora zeae-maydis)
- Corn (Maize) — Common Rust (Puccinia sorghi)
- Corn (Maize) — Northern Leaf Blight (Exserohilum turcicum)
- Corn (Maize) — Healthy Foliage
- Potato — Early Blight (Alternaria solani)
- Potato — Late Blight (Phytophthora infestans)
- Potato — Healthy Foliage
- Tomato — Bacterial Spot (Xanthomonas campestris)
- Tomato — Early Blight (Alternaria solani)
- Tomato — Late Blight (Phytophthora infestans)
- Tomato — Leaf Mold (Passalora fulva)
- Tomato — Septoria Leaf Spot (Septoria lycopersici)
- Tomato — Two-Spotted Spider Mite (Tetranychus urticae)
- Tomato — Target Spot (Corynespora cassiicola)
- Tomato — Yellow Leaf Curl Virus (TYLCV)
- Tomato — Mosaic Virus (ToMV)
- Tomato — Healthy Foliage
Agronomic Usage Disclaimers
[!WARNING] This model is trained primarily on laboratory imagery and is deployed within KrishiAI as an advisory screening tool with confidence gating ($ au = 0.60$). It is not verified for unattended chemical pesticide or fungicide spraying. Physical confirmation by a local Krishi Vigyan Kendra (KVK) agronomist or extension specialist is mandatory prior to applying commercial treatments.
How to Load in Python
import torch
from huggingface_hub import hf_hub_download
from torchvision import models
# 1. Download checkpoint from Hugging Face Hub
ckpt_path = hf_hub_download(
repo_id="Dipxssi/krishiai-mobilenetv3",
filename="mobilenetv3_plantdisease_best.pth",
)
# 2. Recreate model architecture
ckpt = torch.load(ckpt_path, map_location="cpu", weights_only=False)
model = models.mobilenet_v3_small(weights=None)
model.classifier[-1] = torch.nn.Linear(model.classifier[-1].in_features, ckpt["num_classes"])
model.load_state_dict(ckpt["model_state_dict"])
model.eval()
print(f"Loaded {ckpt['architecture']} with {ckpt['num_classes']} classes.")