jfand's picture
Update README.md
9c9245f verified
|
raw
history blame
3.53 kB
metadata
language:
  - en
  - ht
tags:
  - image-classification
  - agriculture
  - maize
  - plant-disease
  - offline-ai
  - mobilenetv2
  - logistic-regression
pipeline_tag: image-classification
license: mit
model_type: mobilenetv2-logistic-regression
datasets:
  - custom-maize-leaf-dataset
fine_tuning: feature-extraction + logistic-regression
library_name: pytorch

AgriBot - Maize Leaf Disease Diagnosis Model

Model Description

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 Ekip Crusaders during the AYITI IA 2025 Hackathon (November 28-30, 2025).

Model Details

  • Architecture: MobileNetV2 (feature extraction) + Logistic Regression (classification)
  • Framework: PyTorch (MobileNetV2) + scikit-learn (LogisticRegression)
  • Model Type: Image Classification
  • Input: RGB images of maize leaves (224x224 pixels)
  • Output: Disease classification with confidence score
  • Accuracy: 94%

Classes

The model can identify 5 different categories:

  1. Cercospora Leaf Spot (Gray Leaf Spot) - Fungal disease causing gray lesions
  2. Common Rust - Fungal disease with orange-brown pustules
  3. Northern Leaf Blight - Fungal disease causing cigar-shaped lesions
  4. Healthy - No disease detected
  5. Other - Non-maize plant or unrecognized pattern

Usage

Installation

pip install torch torchvision scikit-learn pillow numpy joblib

Quick Start

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}%")

Performance

  • Overall Accuracy: 94%
  • Model Size: Lightweight (~15MB)
  • Inference Speed: Fast (suitable for mobile/edge deployment)

Web Application

A complete web application with FastAPI backend is available at: GitHub Repository

Team - Ekip Crusaders

Hackathon: AYITI IA 2025
Dates: November 28-30, 2025
Achievement: 94% accuracy in maize disease classification

License

MIT License - See repository for full license text

Citation

@software{agribot_crusaders_2025,
  title={AgriBot: Maize Leaf Disease Diagnosis Model},
  author={Ekip Crusaders},
  year={2025},
  month={November},
  howpublished={AYITI IA 2025 Hackathon}
}