Lightweight deep learning pipeline that detects cassava leaves, classifies the five major
cassava diseases (CBB, CBSD, CGM, CMD, Healthy), estimates severity and yield loss,
and generates treatment recommendations — including optional LLM-powered farmer advisory
via Ollama (llama3.1:8b).
- YOLOv8n leaf detection + attention-enhanced CNN classification
- Severity estimation with estimated yield loss per diagnosis
- Streamlit app: image upload / live camera, GPS extraction from EXIF, multi-language recommendations, diagnosis history (SQLite) with map & analytics
- LLM advisory mode (Ollama) — falls back to rule-based advice when unavailable
├── src/
│ ├── app.py # Streamlit demo app
│ ├── detection/ # YOLO detector training + ROI extraction
│ ├── classification/ # Classifier model + training
│ ├── pipeline/ # End-to-end detect → classify pipeline
│ ├── recommendations.py # Rule-based + LLM recommendation engine
│ ├── database.py # Diagnosis history (SQLite) + GPS/EXIF
│ └── severity.py # Severity / yield-loss estimation
├── models/ # Trained weights (detector + classifier)
├── configs/ # Training configs
├── doc/ # Thesis documentation
├── Dockerfile # Container deployment
└── requirements.txt
python -m venv venv && source venv/bin/activate
pip install -r requirements.txt
streamlit run src/app.pyOptional LLM recommendations (Ollama):
ollama pull llama3.1:8b && ollama servedocker build -t cassava-detection .
docker run -p 8501:8501 cassava-detection- Push this repo to GitHub.
- Go to share.streamlit.io → New app → select
Innovativcode/cassava-detection, branchmain, main filesrc/app.py. - Deploy — dependencies install from
requirements.txtautomatically.
Note: the Ollama LLM feature is unavailable in the cloud sandbox; the app automatically falls back to the built-in rule-based recommendations.