Annapoorna crop disease CNN
A CNN trained from scratch that predicts the disease from a leaf photo, for 42 classes across cotton, wheat, maize, rice and sugarcane. It is the disease detection model of Annapoorna.
| Dataset | 20K Multi-Class Crop Disease Images |
| Classes | 42 |
| Train / validation | 12,255 / 3,081 images |
| Input | 224x224 RGB, scaled to [0, 1] |
| Training | Adam (lr 1e-4), 25 epochs |
| Validation accuracy | 71.7% |
| Validation loss | 4.02 |
The validation loss is high for that accuracy, so the model is overconfident. Check the confidence of each prediction before relying on it.
The class names, in output order, are in backend/predict.py.
Usage
import numpy as np
from huggingface_hub import hf_hub_download
from PIL import Image
from tensorflow.keras.models import load_model
path = hf_hub_download("v47vansh/annapoorna-crop-disease-cnn", "crop_disease_cnn_model.h5")
model = load_model(path)
img = Image.open("leaf.jpg").convert("RGB").resize((224, 224))
x = np.asarray(img, dtype=np.float32)[None] / 255.0
probabilities = model.predict(x)[0]