Skip to content

titouanlegourrierec/Leaf_Disease_Segmentation

Repository files navigation

LinkedIn Mail

Detection and Segmentation of Diseases on wheat leaves

A tool to segment foliar diseases like powdery mildew or yellow rust on wheat leaves

LE GOURRIEREC Titouan
CONNESSON Léna
PROUVOST Axel

Report a bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. License
  5. Contact
  6. Acknowledgments

About The Project

This project involves the development of a tool and a machine learning model for the detection and segmentation of foliar diseases such as powdery mildew or rust on wheat leaves. Ultimately, this tool is used to compare phenotypic blends of wheat to determine the ideal mixture for increasing yields while reducing pesticide usage.

By employing a random forest algorithm for pixel classification, we demonstrate an accuracy of 99% on isolated disease patches, with average error rates of 14% for rust and 5% for powdery mildew, indicative of minor actual surface errors. Though performance on real leaf samples, characterized by more nuanced textures, is modest, it is enhanced through outlier exclusion, achieving practical accuracies of 62% for rust and 52% for powdery mildew. This study highlights the potential of AI-driven high-throughput methods in mitigating pesticide use through improved understanding and management of crop diseases.

Once executed, the code generates a directory containing the leaves extracted from the original image, along with their segmented versions. Additionally, it produces a CSV file containing information about the labels and areas of each disease, as well as the leaves.

(back to top)

Built With

  • Python
  • OpenCV
  • Shell Script

(back to top)

Getting Started

Prerequisites

  • Ilastik software: To utilize this code, please download the Ilastik software tailored to your computer's operating system from: https://www.ilastik.org/download.

  • Trained model: Additionally, you'll need to download a trained model from this Google Drive link. There are four models available, each corresponding to different color spaces. We recommend downloading the LAB.ilp model for optimal performance.

Installation

  1. Clone the repository
git clone https://github.com/titouanlegourrierec/Leaf_Disease_Segmentation.git
  1. Create a python virtual environment
python -m venv env
  1. Activate your virtual environment

    • For Windows :
    env\Scripts\activate
    • For MacOS & Linux :
    source env/bin/activate
  2. Install the required dependencies from the requirements.txt file

pip install -r requirements.txt

(back to top)

Usage

To use this project, you have two options:

  1. GUI Interface: Utilize it through the graphical user interface.
env/bin/python segmenter.py

Here, you have an interface where you can choose the input directory containing images to process, the directory where processed images will be saved, and the path to the model you want to use. Then, click on the "run" button and wait for the result.

  1. Terminal Command: Use it via command line in the terminal.
env/bin/python segmenter.py -i path/to/input/directory -o path/to/output/directory -p /path/to/trained/model

(back to top)

License

Distributed under the GNU License. See LICENSE for more information.

(back to top)

Contact

LE GOURRIEREC Titouan - titouanlegourrierec@icloud.com

Project Link: https://github.com/titouanlegourrierec/Leaf_Disease_Segmentation

(back to top)

Acknowledgments

  • Ilastik Software : An interactive interface to annotate images to segment.
  • EasIlastik package : A package to facilitate the use of trained model on Ilastik for image segmentation.

(back to top)