Skip to content

Repository files navigation

🌿 Sick-greens

A deep learning system for plant disease detection and progression tracking built on the PlantVillage dataset. Given a leaf image, the model identifies the disease, classifies its stage (healthy → early → mid → late), estimates days since infection, and computes a treatment urgency score.

Open in Colab CI Python TensorFlow Keras MobileNetV2 Dataset Classes Stages License Hugging Face Streamlit App

What It Does

  • Disease Classification — identifies plant disease across 38 classes (e.g. Apple Scab, Tomato Late Blight, Potato Early Blight)
  • Stage Classification — maps each disease to one of 4 progression stages:
    • Stage 0 — Healthy
    • Stage 1 — Early
    • Stage 2 — Mid-stage
    • Stage 3 — Late-stage
  • Days Estimation — regression head estimates days since infection onset
  • Urgency Scoring — outputs a 0–10 urgency score with action recommendations (Low / Moderate / High / Critical)
  • Temporal Tracking — tracks disease progression across multiple images over time and plots stage & urgency curves

Dataset

PlantVillage via TensorFlow Datasets (tfds.load('plant_village'))

  • 38 disease/healthy classes across crops including Tomato, Potato, Apple, Grape, Corn, Peach, Pepper, Strawberry, and more
  • Capped at ~100–102 images per class for balanced training
  • Split: 70% train / 15% validation / 15% test

Model Architecture

  • Backbone: MobileNetV2 (pretrained on ImageNet, fine-tuned)
  • Heads:
    • Disease classification head (38-class softmax)
    • Stage classification head (4-class softmax)
    • Days regression head (single neuron)
  • Class weights applied to handle imbalance

Evaluation Metrics

Task Metric
Disease Classification Accuracy, Weighted F1
Stage Classification Accuracy, Weighted F1
Days Estimation MAE, RMSE

Tech Stack

  • Python, TensorFlow / Keras
  • TensorFlow Datasets
  • MobileNetV2
  • Pandas, NumPy
  • Matplotlib, Seaborn, Plotly
  • scikit-learn
  • OpenCV, Pillow

Requirements

Install all dependencies via:

pip install -r requirements.txt

Note: If running on Google Colab, the notebook auto-installs all dependencies in its first cell — no manual setup needed.

Key requirements at a glance:

Package Version
tensorflow ≥ 2.12.0
tensorflow-datasets ≥ 4.9.0
keras ≥ 2.12.0
scikit-learn ≥ 1.2.0
opencv-python-headless ≥ 4.7.0
Pillow ≥ 9.4.0
numpy ≥ 1.23.0
pandas ≥ 1.5.0
matplotlib ≥ 3.6.0
seaborn ≥ 0.12.0
plotly ≥ 5.14.0

See requirements.txt for the full pinned list.


Getting Started

  1. Clone the repo:

    git clone https://github.com/sharr-catalyst/Sick-greens.git
    cd Sick-greens
  2. (Optional — local run only) Install dependencies:

    pip install -r requirements.txt
  3. Open YourGreensAreSick_v2.ipynb in Google Colab

  4. Run all cells: Runtime → Run all

    The notebook will auto-install all dependencies in the first cell.


📂 Project Structure

Sick-greens/
│
├── models/                         
│   ├── metadata.json                 # Contains training metrics, dataset sizes, and architecture data
│      
│
├── outputs/                          # 📊 Training visualization assets
│   ├── confusion_matrices.png
│   ├── limited_class_distribution.png
│   ├── progression_curve.png
│   ├── sample_images.png
│   ├── sample_predictions.png
│   └── training_history.png
│
├── README.md                         
├── app.py                           
├── requirements.txt                  
└── YourGreensAreSick_v2.ipynb       

Model

The trained model is hosted on Hugging Face:

Hugging Face

To download programmatically:

from huggingface_hub import hf_hub_download

model_path = hf_hub_download(
    repo_id="Sharmistha-catalyst/sick-greens-plant-disease",
    filename="final_progression_model.h5"
)

Web App

Streamlit App


Project Report

View Report


Author

sharr-catalystGitHub

About

A multi-task deep learning pipeline leveraging a pretrained MobileNetV2 backbone to jointly classify disease type, progression stage, and days since infection from leaf imagery. Outputs feed an urgency scoring function for actionable treatment recommendations..

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages