Featured Project — Computer Vision
CottonDoctor-PK
A computer-vision tool that classifies cotton leaf diseases from a photograph, built to help Pakistan’s cotton farmers and agronomists spot crop disease earlier.
The Problem
Cotton is a backbone crop of Pakistan’s textile economy, and leaf diseases can cut yields heavily before they are obvious to the eye. Expert diagnosis is scarce in the field, so infections are often treated late — or treated blindly with the wrong pesticide.
What I Built
- A transfer-learning image classifier fine-tuned from EfficientNet-B0 on a labeled dataset of cotton leaf photographs.
- A simple web app: upload or photograph a leaf, and the model returns its diagnosis with confidence — no account, no setup.
Technical Approach
- Transfer learning: ImageNet-pretrained EfficientNet-B0 with a custom classification head, fine-tuned in two stages (frozen backbone, then partial unfreezing).
- Data pipeline: resizing, normalization and augmentation (flips, rotations, brightness jitter) to generalize beyond studio-style leaf photos.
- Evaluation: a held-out test split the model never saw during training, reported honestly below.
- Delivery: the trained model served behind a Streamlit interface for instant field use.
Technologies & Stack
Results
89.72% accuracy on the held-out test set. The live demo is public — try it with any cotton leaf photo.
Limitations
Field photos with cluttered backgrounds, mixed infections or severe blur are harder than the test distribution, and accuracy there will be lower. CottonDoctor-PK is a screening aid, not a replacement for an agronomist’s diagnosis.