How tusm11/crop-disease-detection-and-fertilizer-recommendation-system works
This is a Streamlit crop-health application with two user-facing workflows: leaf-image disease diagnosis and soil/crop-based fertilizer recommendation. The app coordinates image preprocessing and CNN inference, then uses the predicted crop and selected soil type for fertilizer prediction and SHAP explanations. The README also documents disease-indicator heatmaps. Some UI and heatmap implementation lines were not sampled, so those capabilities are represented from README documentation rather than inferred source calls.
Main entry points: app.py Fertilizer prediction · soil_lookup.py Soil-crop values · fertilizer_ada_model.pkl AdaBoost model · plant_cnn_model.keras CNN model
Components 15
Streamlit application
- Application UI
app.py - Image upload
app.py - Soil selection
app.py
Disease diagnosis
- CNN inference
app.py - Disease diagnosis
app.py - Feature impact map
app.py
Fertilizer recommendation
- Soil-crop values
soil_lookup.py - Fertilizer prediction
app.py - SHAP explanation
app.py
Data and models
- CNN model
models/plant_cnn_model.keras - Disease labels
models/class_names.json - Recommendation data
fertilizer_recommendation.csv - AdaBoost model
models/fertilizer_ada_model.pkl - Encoders and scaler
models
Other components
- Grower
Connections 18
- Grower → Application UI: uses
README.md - Application UI → Image upload: offers upload
app.py - Image upload → CNN inference: provides image
app.py - CNN inference → CNN model: loads model
app.py - CNN inference → Disease labels: uses labels
README.md - CNN inference → Disease diagnosis: predicts class
README.md - Disease diagnosis → Feature impact map: visualizes indicators
README.md - Application UI → Soil selection: offers selection
app.py - Soil selection → Fertilizer prediction: requests recommendation
app.py - Fertilizer prediction → Soil-crop values: gets values
app.py - Soil-crop values → Recommendation data: samples rows
soil_lookup.py - Fertilizer prediction → AdaBoost model: predicts fertilizer
app.py - Fertilizer prediction → Encoders and scaler: uses encoders
app.py - Fertilizer prediction → SHAP explanation: computes attribution
app.py - SHAP explanation → AdaBoost model: explains prediction
app.py - Disease diagnosis → Grower: shows diagnosis
README.md - Fertilizer prediction → Grower: shows recommendation
README.md - SHAP explanation → Grower: shows rationale
README.md