Downloads · 30 days
0
crusadersAI/agribot-maize-diagnosis
agribot-maize-diagnosis is a machine learning model from crusadersAI. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
AgriBot is a machine learning model for diagnosing maize (corn) leaf diseases. The model uses MobileNetV2 as a feature extractor combined with Logistic Regression for classification, achieving 94% accuracy.
Downloads · 30 days
0
Access
Public
Updated Dec 5, 2025
Repo size
14.3 MB
Likes
4
Public
Click a slice to open those files.
.pkl14.3 MB · 100%
From the Hugging Face model README
AgriBot is a machine learning model for diagnosing maize (corn) leaf diseases. The model uses MobileNetV2 as a feature extractor combined with Logistic Regression for classification, achieving 94% accuracy.
This model was developed by Crusaders during the AYITI IA 2025 Hackathon (November 28-30, 2025).
The model can identify 5 different categories:
This model was trained on the Corn or Maize Leaf Disease Dataset from Kaggle:
Dataset Link: https://www.kaggle.com/datasets/smaranjitghose/corn-or-maize-leaf-disease-dataset
Dataset Details:
Data Preprocessing:
We thank the dataset creator for making this valuable resource available to the community.
pip install torch torchvision scikit-learn pillow numpy joblib
import joblib
import torch
import numpy as np
from PIL import Image
from torchvision import models, transforms
# Load the model
model = joblib.load('agribot_models.pkl')
# Load MobileNetV2 for feature extraction
mobilenet = models.mobilenet_v2(pretrained=True)
mobilenet.classifier = torch.nn.Identity()
mobilenet.eval()
# Image preprocessing
transform = transforms.Compose([
transforms.Resize((224, 224)),
transforms.ToTensor(),
transforms.Normalize(mean=[0.485, 0.456, 0.406],
std=[0.229, 0.224, 0.225])
])
# Load and preprocess image
image = Image.open('maize_leaf.jpg').convert('RGB')
img_tensor = transform(image).unsqueeze(0)
# Extract features
with torch.no_grad():
features = mobilenet(img_tensor).numpy()
# Predict
prediction = model.predict(features)[0]
probabilities = model.predict_proba(features)[0]
confidence = float(np.max(probabilities) * 100)
# Class labels
class_labels = [
"Cercospora Leaf Spot (Gray Leaf Spot)",
"Common Rust",
"Northern Leaf Blight",
"Healthy",
"Other"
]
print(f"Diagnosis: {class_labels[prediction]}")
print(f"Confidence: {confidence:.2f}%")
Primary Use Cases:
Limitations:
This model was developed during the AYITI IA 2025 Hackathon by Crusaders team members.
Hackathon: AYITI IA 2025
Dates: November 28-30, 2025
Achievement: 94% accuracy in maize disease classification
Our Approach: Unlike most hackathon projects that focused on fine-tuning LLMs and API integrations, we took a different path:
A complete web application with FastAPI backend and interactive frontend is available at: GitHub Repository
The web app provides:
MIT License
Copyright (c) 2025 Crusaders
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
If you use this model in your research or application, please cite:
@software{agribot_crusaders_2025,
title={AgriBot: Maize Leaf Disease Diagnosis Model},
author={Crusaders},
year={2025},
month={November},
howpublished={AYITI IA 2025 Hackathon},
url={https://huggingface.co/crusadersAI/agribot-maize-diagnosis}
}
For questions, issues, or collaboration: