A fully reproducible deep-learning pipeline for brown rust, ramularia, and multiclass segmentation.
This repository provides a unified, end-to-end system for automated segmentation and phenotyping of barley leaf diseases. It supports:
- A quick demo inference
- Fully automated figure reproduction from the associated manuscript
- A complete training pipeline with two-phase HPO, encoder selection, retraining, and inference
Reference Paper:
git clone https://github.com/grimmlab/barley-disease-segmentation.git
cd barley-disease-segmentationdocker build -t barley_disease_segmentation_image .
docker run -it \
--gpus '"device=0"' \
--volume $(pwd):/workspace \
barley_disease_segmentation_imagepip install -e .Optional: edit barley_disease_segmentation>config.py to customise paths
Download the following three folders from Mendeley Data, DOI: doi.org/10.17632/4ny92p2r8f.1:
hpo_data/inference_data/data_patches/
Place them in the repository root.
You can use the repository in three main ways, depending on your goal.
Run a minimal demo using default settings.
python Inference_quick_start.py \
--encoder convnext_tiny \
--task multiclass \
--test_data_path Sample_test_data \
--run_leaf_evaluation \
--leaf_evaluation_output quick_start_resultsOutput:
quick_start_results/ containing predictions, leaf-level visualisations, and evaluation metrics.
Reproduce all figures from the manuscript.
cd Figure\ Reproduction/
python Reproduce_figures.pyThe figures are in the respective folders in Figure Reproduction
A full workflow: 2-phase HPO → encoder selection → retraining → inference.
Supported segmentation tasks:
binary_rambinary_rustmulticlass
cd Complete\ Pipeline/
python Complete_pipeline.py \
--task multiclass \
--skip-hpoIf --skip-hpo is omitted, the pipeline performs broad + refined Optuna HPO (~6 days on a single GPU).
| Argument | Description | Default |
|---|---|---|
--task {binary_ram, binary_rust, multiclass} |
Segmentation task (required) | — |
--skip-hpo |
Use existing HPO results instead of running Optuna | False |
--trials N |
Number of HPO trials (if HPO active) | 60 |
--epochs N |
Epochs for final retraining | 300 |
--experiment-name |
MLflow experiment name | None |
--dry-run |
Print commands without executing | False |
The pipeline automatically executes:
- Broad-phase HPO
- Refined HPO
- Encoder benchmarking
- Final retraining with best hyperparameters
- Leaf-level inference and evaluation
This work is currently under review:
Deep Learning–Based Identification of Visually Similar Foliar Diseases in Field-Grown Barley
Sofia Martello, Nikita Genze & Dominik G. Grimm