Sign inSign up

phytooracle/charcoal-dryrot-quantification

By phytooracle

•Updated over 2 years ago

Image
0

1.5K

phytooracle/charcoal-dryrot-quantification repository overview

⁠Classification & Quantification of Charcoal Rot of Sorghum

⁠Background

⁠Biological problem

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.

Alt text

Charcoal rot of sorghum (CRS) symptoms in sorghum plant grown in Maricopa, Arizona.

⁠Model Types

This algorithm detects CRS using various classes of machine learning models, including:

  • Classification

    • ResNet18
    • MobileNetV3 small
    • MobileNetV3 small custom
    • MobileNetV3 large
    • EfficientNet-B3
    • EfficientNet-B4 (Koonce 2021a)
  • Segmentation

    • U-NET
    • Fully Convolutional Network (FCN)
    • DeepLabV3

⁠Running Code

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

Training requires: (i) experiment file, (ii)

⁠Generate Experiment File

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:

⁠Classification
python3 model_training/training_and_inference/generate_hyperparameter_experiments.py --path hyperparameter_experiment --name classification --type c
⁠Segmentation
python3 model_training/training_and_inference/generate_hyperparameter_experiments.py --path hyperparameter_experiment --name segmentation --type s
⁠Train models
⁠Classification

To train classification models, run:

python3 model_training/training_and_inference/run_next_experiment.py --path hyperparameter_experiment/classification_config_and_results_file.csv
⁠Segmentation

To train segmentation models, run:

python3 model_training/training_and_inference/run_next_experiment.py --path hyperparameter_experiment/segmentation_config_and_results_file.csv
⁠Running Inference
⁠Classification

To run inference and quantification using classification models and segmentation models, run:

./model_training/quantification_and_plots/run_all_quantifications.sh
⁠Jupyter Notebook: Classification & Segmentation

We also provide a Jupyter notebook to visually assess the trained model's predictions:

model_training/quantification_and_plots/test_models_inference.ipynb

⁠Streamlit App

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.

Alt text

Charcoal rot of sorghum (CRS) symptoms in sorghum plant grown in Maricopa, Arizona.

⁠Docker

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/⁠

⁠Singularity

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/⁠

Tag summary

Content type

Image

Digest

sha256:f9691a17d…

Size

7 GB

Last updated

over 2 years ago

docker pull phytooracle/charcoal-dryrot-quantification