Binary segmentation of diseased regions on plant leaves using a UNet architecture with a pretrained MobileNetV2 encoder. Trained on the PlantSegV2 dataset.
Columns: Input Image | Ground Truth Mask | Predicted Mask
The model segments diseased regions well on most samples. Some over-prediction occurs on complex backgrounds, likely due to similar texture/color between disease and background.
- Model: UNet + MobileNetV2 encoder (ImageNet pretrained)
- Loss: BCE + Dice (50/50)
- Input size: 256×256
- Classes: 1 (binary — disease vs background)
- Source: PlantSegV2 (Kaggle)
- Size: ~11k images
pip install -r requirements.txtpython3 train.py # default config.yaml
python3 train.py --config my_config.yaml # custom configAll hyperparameters are in config.yaml.
python3 eval.py --split test
python3 eval.py --split test --n 10 --save-dir ./eval_outputpython3 app.pyLaunches a Gradio web interface. Upload a leaf image and get the overlay and the predicted mask. Must have a trained model under: ./checkpoints/best.pth
