Skip to content

Plant Disease Detectionย #256

Description

@keshripritesh

๐ŸŒฑ Plant Disease Detection

A deep learning-based project aimed at detecting plant diseases from images using PyTorch models. This project is part of GirlScript Summer of Code (GSSoCโ€™25) contributions.


๐ŸŽฏ Aim

The goal of this project is to help farmers and agricultural researchers by providing an AI-powered solution for detecting plant diseases early, thereby improving crop health and productivity.


๐Ÿ“‚ Project Contents

  • plant-disease-model.pth & plant-disease-model-complete.pth โ†’ Pre-trained PyTorch models for disease classification
  • test/ โ†’ Sample test images (healthy & diseased plants)
  • Screenshot 2025-06-19 175549.png, Screenshot 2025-06-19 175613.png, Screenshot 2025-06-19 175628.png โ†’ Example model prediction screenshots

๐Ÿ› ๏ธ Steps Involved

  • Collecting and preprocessing plant disease dataset
  • Training deep learning models (PyTorch CNNs)
  • Saving trained models for inference
  • Testing using sample images
  • Visualizing model outputs with prediction screenshots

๐Ÿค– Model Used

  • Pre-trained PyTorch CNN models (saved as .pth files)

๐Ÿ“š Libraries Required

  • torch
  • torchvision
  • numpy
  • pandas
  • matplotlib
  • PIL

๐Ÿš€ Usage

Example inference code:

import torch
from PIL import Image
from torchvision import transforms

# Load model
model = torch.load('plant-disease-model.pth')
model.eval()

# Preprocess input
transform = transforms.Compose([
    transforms.Resize((224,224)),
    transforms.ToTensor(),
])
img = Image.open("test/sample_leaf.jpg")
input_tensor = transform(img).unsqueeze(0)

# Prediction
with torch.no_grad():
    output = model(input_tensor)
    predicted_class = output.argmax(dim=1).item()
print("Predicted Class:", predicted_class)

๐Ÿ“ธ Output Snapshots

  • Example predictions shown in:
Image Image Image

โœ… Conclusion

The project demonstrates how deep learning can be applied to agriculture by providing an automated method to classify plant diseases.


Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions