A deep learning application that uses Convolutional Neural Networks (CNNs) to classify potato plant leaves as Blight or Non-Blight, helping farmers in India detect fungal infections early and protect their crops.
Late blight and early blight are fungal diseases that devastate potato crops, caused by Phytophthora infestans and Alternaria solani respectively. Left undetected, these diseases can destroy entire harvests.
This project trains a CNN model on images of potato leaves to automatically detect whether a crop is infected — giving farmers a fast, accessible tool for early intervention without requiring expert agronomists on-site.
- Image Input — A photo of a potato plant leaf is captured (via camera or upload).
- Preprocessing — The image is resized, normalized, and prepared for the model.
- CNN Inference — A trained Convolutional Neural Network classifies the leaf.
- Output — The app reports whether the crop is Blighted or Healthy (Non-Blight).
PotatoClassification/
│
├── data/ # Dataset: blight and non-blight leaf images
│ ├── train/
│ │ ├── blight/
│ │ └── non_blight/
│ └── val/
│ ├── blight/
│ └── non_blight/
│
├── models/ # Saved trained model weights
│
├── notebooks/ # Jupyter notebooks for training and EDA
│
├── src/
│ ├── train.py # Model training script
│ ├── predict.py # Run inference on new images
│ └── preprocess.py # Image preprocessing utilities
│
├── app/ # Web/mobile interface (if applicable)
│
├── requirements.txt
└── README.md
Note: This structure will evolve as the project is built out.
- Python 3.8+
- pip
- (Recommended) A GPU with CUDA support for faster training
git clone https://github.com/sleepypant/PotatoClassification.git
cd PotatoClassification
pip install -r requirements.txtThis project uses the PlantVillage dataset available on Kaggle, which includes labeled images of potato leaves across three categories:
- Potato — Early Blight
- Potato — Late Blight
- Potato — Healthy
Download the dataset and place the relevant folders inside the data/ directory.
python src/train.py --epochs 25 --batch_size 32python src/predict.py --image path/to/leaf_image.jpgThe classifier is built using a CNN architecture. The current approach:
- Base model: Custom CNN (with plans to benchmark against transfer learning approaches such as ResNet50 or EfficientNet)
- Input: RGB images, resized to 256×256
- Output: Binary classification — Blight / Non-Blight
- Loss: Binary Cross-Entropy
- Optimizer: Adam
| Metric | Value |
|---|---|
| Accuracy | TBD |
| Precision | TBD |
| Recall | TBD |
| F1 Score | TBD |
Results will be updated as training experiments are completed.
This tool is designed for farmers in India who need a practical, low-cost way to monitor their crops. The goal is to deploy this as a simple mobile-friendly web app where a farmer can take a photo of a leaf and receive an immediate diagnosis — no internet required (offline inference planned).
- Repository setup
- Data collection and preprocessing pipeline
- Baseline CNN model training
- Transfer learning experimentation
- Model evaluation and tuning
- Simple web/mobile UI for farmers
- Offline inference support
- Hindi language support in UI
Contributions are welcome! Please open an issue first to discuss any major changes. Pull requests for bug fixes, dataset improvements, or model enhancements are encouraged.
This project is licensed under the Apache 2.0 License.
- PlantVillage Dataset — for the labeled leaf images
- TensorFlow / PyTorch — deep learning frameworks
- Farmers across India whose livelihoods inspired this project