Sorghum is the fifth most widely grown cereal crop, capable of growing on marginal lands not suitable for other crops. Charcoal rot of sorghum (CRS), a disease caused by the pathogen M. phaseolina, poses a significant threat to sorghum, as it reduces yields and thus has signficant economic effects. Developing machine learning (ML) models that can categorize and quantify CRS would be immediately useful to growers and breeders, and as a way to identify variation in disease resistance to use in crop improvement efforts.
This algorithm detects CRS using various classes of machine learning models, including:
Classification
Segmentation
To run either training or inference, you will need to download the dataset here. This archive file (.tar) contains both original and annotated images.
Training requires: (i) experiment file, (ii)
A JSON file with hyperparameters experiments is produced to conduct a hyperparameter grid search, aimed at identifying the optimal hyperparameters for both classification and segmentation models. To generate this file, run:
python3 model_training/training_and_inference/generate_hyperparameter_experiments.py --path hyperparameter_experiment --name classification --type c
python3 model_training/training_and_inference/generate_hyperparameter_experiments.py --path hyperparameter_experiment --name segmentation --type s
To train classification models, run:
python3 model_training/training_and_inference/run_next_experiment.py --path hyperparameter_experiment/classification_config_and_results_file.csv
To train segmentation models, run:
python3 model_training/training_and_inference/run_next_experiment.py --path hyperparameter_experiment/segmentation_config_and_results_file.csv
To run inference and quantification using classification models and segmentation models, run:
./model_training/quantification_and_plots/run_all_quantifications.sh
We also provide a Jupyter notebook to visually assess the trained model's predictions:
model_training/quantification_and_plots/test_models_inference.ipynb
The models trained here can be deployed on a Streamlit app. The hosted app is accessible here. The app can also be executed locally by utilizing Docker/Singularity.
First, pull the container:
sudo docker run -d -p 8501:8501 --name crs phytooracle/charcoal-dryrot-quantification:latest
Then, run the app:
sudo docker exec crs streamlit run /opt/model_training/inference.py -- -i /opt/images/test_patches/ --server.port 8501
Finally, you can interact with the application in your web browser by navigating to: http://localhost:8501/
First, build the container:
singularity build crs.simg docker://phytooracle/charcoal-dryrot-quantification:latest
Then, run the app:
singularity exec -B $(pwd):/mnt --pwd /mnt --nv crs.simg streamlit run inference.py -- -i /opt/images/test_patches/
Finally, you can interact with the application in your web browser by navigating to: http://localhost:8501/
Content type
Image
Digest
sha256:f9691a17d…
Size
7 GB
Last updated
over 2 years ago
docker pull phytooracle/charcoal-dryrot-quantification