Plant Disease Classifier
1 min readupdated
This image classifier determines whether plant leaves are healthy or diseased from a photograph. The system recognizes 39 different condition classes and was created as a training project by the KCL team. The solution is based on the ResNet18 architecture (a convolutional neural network for computer vision), fine-tuned on the PlantVillage dataset. This tool suits developers and researchers building crop health monitoring applications.
Key features
- ResNet18 architecture, fine-tuned across all layers
- High recognition accuracy (Top-1 accuracy 99.47%)
- Trained on the PlantVillage dataset for 39 classes
- Macro F1 metric at 0.992 on the test set
What you can do
- Determine plant condition from an uploaded leaf photograph
- Integrate the ready-made model into custom image processing scripts
- Use the weights file along with class names
Example
Running an image check using a Python script:
from huggingface_hub import hf_hub_download
from predict import load_checkpoint, predict_topk
from PIL import Image
model, ckpt = load_checkpoint(hf_hub_download("Asad981/plant-disease-model", "plant_model.pt"))
print(predict_topk(model, ckpt, Image.open("leaf.jpg"), k=5))
Read more
Details• Top-1 accuracy: 99.47%
• Top-5 accuracy: 100%
• Macro F1: 0.992
• Training: Pretrained ImageNet ResNet18, AdamW, cosine schedule










Comments