How psvedant/leafnet_mcmd_gradcam works
LeafNet-MCMD is a plant-leaf disease classification project: it prepares image datasets, trains a compact custom CNN, and produces evaluation, explainability, and error-audit outputs. Its separate FastAPI application accepts an uploaded image and returns a prediction with a Grad-CAM visualization. The main training and analysis relationships below follow the README pipeline; the app’s inference and heatmap steps are visible in its excerpt. Other model variants and experimental scripts are not expanded into separate runtime flows.
Main entry points: data Train, val, test · outputs_novel Trained model · custom_cnn.py Train and checkpoint · evaluate_custom.py Multiclass metrics
Components 18
Dataset preparation
- Stage raw data
src/setup_folders.py - Raw dataset
data/raw - Build splits
src/split_dataset.py - Train, val, test
data
Model development
- Custom CNN blocks
src/custom_cnn.py - Train and checkpoint
src/custom_cnn.py - Trained model
outputs_novel
Model analysis
- Multiclass metrics
src/evaluate_custom.py - Reports and plots
outputs_novel/evaluation - Grad-CAM heatmaps
src/gradcam.py - Class heatmaps
outputs_novel/gradcam - Error audit
src/analyze_errors.py - Error images and CSV
outputs_novel/error_analysis
Prediction API
- Prediction endpoint
app.py - Class prediction
app.py - Prediction heatmap
app.py
Other components
- Plant disease images
- Image submitter
Connections 19
- Plant disease images → Stage raw data: stages
README.md - Stage raw data → Raw dataset: writes
README.md - Raw dataset → Build splits: provides images
README.md - Build splits → Train, val, test: creates
README.md - Train, val, test → Train and checkpoint: trains on
README.md - Custom CNN blocks → Train and checkpoint: builds model for
README.md - Train and checkpoint → Trained model: saves
README.md - Trained model → Multiclass metrics: evaluates
README.md - Train, val, test → Multiclass metrics: supplies test data
README.md - Multiclass metrics → Reports and plots: writes
README.md - Trained model → Grad-CAM heatmaps: explains predictions
README.md - Train, val, test → Grad-CAM heatmaps: supplies test images
README.md - Grad-CAM heatmaps → Class heatmaps: writes
README.md - Trained model → Error audit: audits errors
README.md - Train, val, test → Error audit: supplies test images
README.md - Error audit → Error images and CSV: writes
README.md - Image submitter → Prediction endpoint: uploads image
app.py - Prediction endpoint → Class prediction: predicts
app.py - Class prediction → Prediction heatmap: generates heatmap
app.py