Logo Lanfrica

shama-datta/maize-disease-detection

Domain:

agriculture

Record type:

softwaremodel
Creator:
sha
Host:
# 🌽 Maize Leaf Disease Detection β€” CNN & VGG16 An interactive **Streamlit** web app that classifies maize (corn) leaf diseases from an uploaded photo using two deep-learning models: a **custom CNN** and **VGG16 transfer learning**. It shows the raw image, the preprocessing pipeline, the predicted disease with a reference leaf image, and full evaluation visualisations β€” accuracy curves, **ROC plot**, **confusion matrix** and **classification report** β€” in a professional purple theme with Cambria typography. **Classes:** `Blight` (Northern Leaf Blight) Β· `Common_Rust` Β· `Gray_Leaf_Spot` Β· `Healthy` --- ## 1. Project structure ``` maize-disease-detection/ β”œβ”€β”€ app.py # Streamlit web app (purple theme + Cambria) β”œβ”€β”€ train.py # Train custom CNN and VGG16 β”œβ”€β”€ evaluate.py # ROC, confusion matrix, classification report β”œβ”€β”€ utils.py # Config + preprocessing helpers β”œβ”€β”€ requirements.txt β”œβ”€β”€ Dockerfile # For Cloud Run β”œβ”€β”€ .dockerignore β”œβ”€β”€ .streamlit/config.toml # Base theme β”œβ”€β”€ models/ # Saved models (created by train.py) β”œβ”€β”€ artifacts/ # Eval JSON read by the app (created by evaluate.py) └── Dataset/ # You download this (one folder per class) ``` --- ## 2. Get the dataset Download from either source and unzip so the folders look like `Dataset/ /*.jpg`: - Kaggle: - GitHub: ```bash # Kaggle CLI option pip install kaggle kaggle datasets download -d smaranjitghose/corn-or-maize-leaf-disease-dataset unzip corn-or-maize-leaf-disease-dataset.zip -d Dataset ``` > Make sure the four sub-folders are named exactly > `Blight`, `Common_Rust`, `Gray_Leaf_Spot`, `Healthy` > (rename if the download uses spaces). This matches `CLASS_NAMES` in `utils.py`. --- ## 3. Set up and run locally ```bash python -m venv .venv && source .venv/bin/activate # Windows: .venv\Scripts\activate pip install -r requirements.txt python train.py --model both --epochs 20 # trains CNN + V …