How saikoushik2108/crop-disease-detection works
Paddy Doctor is a web-based paddy disease diagnostic system: a user submits a leaf image and agronomic details, the backend returns a multimodal disease prediction, and the dashboard presents the findings. Its documented runtime context and Grad-CAM explainability are distinct supporting capabilities. Training and data preparation form an internal model-development layer. Some central runtime modules were not excerpted; uncertain connections are omitted or marked unverified.
Main entry points: train_all.py Experiment orchestration · multimodal_net.py Fusion classifier · prepare_data.py Dataset preparation · engine.py Prediction engine
Components 20
User experience
- Diagnosis dashboard
frontend/src/App.jsx - API client
frontend/src/services/api.js
Diagnosis serving
- FastAPI service
api/main.py - Prediction engine
src/inference/engine.py - Fusion classifier
src/models/multimodal_net.py - Image encoder
src/models/baseline_image.py - Context encoder
src/models/baseline_tabular.py
Runtime context
- Environmental context
src/context/engine.py
Model development
- Configuration utilities
src/utils/config.py - Experiment orchestration
src/training/train_all.py - Training loop
src/training/trainer.py - Classification metrics
src/evaluation/metrics.py - Grad-CAM explanations
src/evaluation/gradcam.py
Data preparation
- Dataset preparation
src/data/prepare_data.py - Stratified splitting
src/data/splitter.py - Tabular preprocessing
src/preprocessing/tabular_pipeline.py - Training dataset
src/data/dataset.py - Image transforms
src/preprocessing/image_transforms.py
Other components
- Field user
- Weather and geographic APIs
Connections 22
- Field user → Diagnosis dashboard: submits inputs
README.md - Diagnosis dashboard → API client: requests diagnosis
frontend/src/App.jsx - API client → FastAPI service: posts image and context
frontend/src/services/api.js - FastAPI service → Prediction engine: delegates prediction
api/main.py - Prediction engine → Fusion classifier: runs classifier
- Fusion classifier → Image encoder: extracts visual features
src/models/multimodal_net.py - Fusion classifier → Context encoder: extracts context features
src/models/multimodal_net.py - Environmental context → Weather and geographic APIs: fetches runtime context
- Prediction engine → Environmental context: adds interpretation context
- Dataset preparation → Configuration utilities: loads settings
src/data/prepare_data.py - Dataset preparation → Stratified splitting: creates splits
src/data/prepare_data.py - Dataset preparation → Tabular preprocessing: fits preprocessing
src/data/prepare_data.py - Experiment orchestration → Configuration utilities: loads settings
src/training/train_all.py - Experiment orchestration → Training dataset: builds datasets
src/training/train_all.py - Experiment orchestration → Tabular preprocessing: transforms metadata
src/training/train_all.py - Experiment orchestration → Image transforms: configures image transforms
src/training/train_all.py - Experiment orchestration → Image encoder: trains image baseline
src/training/train_all.py - Experiment orchestration → Context encoder: trains context baseline
src/training/train_all.py - Experiment orchestration → Fusion classifier: trains fusion model
src/training/train_all.py - Experiment orchestration → Training loop: runs training loop
src/training/train_all.py - Experiment orchestration → Classification metrics: computes scores
src/training/train_all.py - Experiment orchestration → Grad-CAM explanations: generates explanations
src/training/train_all.py