Skip to content

William-Yao0993/SCAN

Repository files navigation

Stomatal Comprehensive Automated Neural Network(SCAN)

About

The Stomatal Comprehensive Automated Neural Network (SCAN) is a deep learning-based software tool developed for the automated measurement of stomatal traits in Brassica napus (canola). SCAN integrates high-resolution digital microscopy with a YOLOv8-based machine learning pipeline to accurately quantify stomatal density, stomatal size, and pore area from leaf surface images. Designed with accessibility in mind, SCAN offers a portable, offline desktop application that requires no advanced programming knowledge, making it suitable for researchers in plant biology and field phenotyping. In addition to its high accuracy in canola, SCAN demonstrates generalizability across multiple plant species not included in its training dataset, including Arabidopsis, rice, wheat, and maize. By combining non-destructive imaging, real-time analysis, and minimal hardware requirements, SCAN supports high-throughput, field-deployable phenotyping of leaf stomatal traits.

SCAN workflow

System Requirements

Before installation, ensure the following tools are installed:

  • Miniconda (for Python environment management)
  • Git (for repository cloning)

Installation Instructions

Step 1: Install Miniconda and Git

Install Miniconda appropriate for your operating system. After installation, initialize the shell:

  • Windows:
    Open Command Prompt / Anaconda Prompt (Miniconda3) and execute:
    conda init
  • macOS/Linux: Open a terminal and run:
    ~/miniconda3/bin/conda init bash
    ~/miniconda3/bin/conda init zsh

Ensure git is installed by downloading it from the official Git site.

Step 2: Clone the Repository

In your Command Prompt or Anaconda Prompt, clone the SCAN repository and navigate to the directory:

git clone https://github.com/William-Yao0993/SCAN.git
cd SCAN

Step 3: Set Up the Python Environment

Create the SCAN environment using the provided YAML file:

conda env create -f environment.yml

Running SCAN

  1. Open Command Prompt from your computer

  2. Ensure your working directory is the SCAN project folder:

    cd SCAN
  3. Activate the SCAN environment:

    conda activate SCANenv
  4. Launch the application:

    python -m main

Note: The first initialization may take 10–20 seconds depending on system performance.


Step-by-Step Guide to Using SCAN

Step 1: Select Your Data Folder

Click Browse and choose the main folder containing your image dataset.

Step 2: Click Execute

This will load your data into SCAN.

Step 3: Confirmation

A popup message will confirm:
"Data Successfully Imported! Please Go to Run Section."

input_data

Step 4: Navigate to the Run Tab

Here you can configure parameters for different species, such as:

  • Aperture Step
  • Confidence Threshold
  • Scale Bar Length (Unit & Pixels)

Refer to the table for typical values by species.

Step 5: Click Execute to Start Model Prediction

SCAN will perform stomata detection, segmentation, and pore analysis.
Progress is shown in the status bar below.

Step 6: Execution Complete

You’ll receive a popup:
"Execution Completed. Please Start the Next Operation."

Step 7: Go to the Result Tab

Switch to view:

  • Detection Images
  • Statistical Plots
  • Raw Data Tables

Use the dropdown to switch folders, and arrow buttons to browse images.

Step 8: Click Execute

Apply the display settings for the selected output type.

Step 9: Navigate to the Export Tab

Select which outputs to save:

  • Images
  • Plots
  • Excel Data

Step 10: Click Execute

Exports your selected outputs.

Step 11: Export Complete

A popup confirms the save location:
Files are stored in a subfolder named predict under your input directory.


Scale bar practical measurement

Species Resolution Magnification Length1 Unit1 Length2 Unit2
Arabidopsis 2560 X 1920 690.5±1 X 0.05 mm 221 pixel
Canola 2560 X 1920 692±2 X 0.05 mm 222 pixel
Canola 1280 X 960 691±2 X 0.05 mm 112 pixel
Maize 2560 X 1920 413±1 X 0.1 mm 269 pixel
Tobacco 2560 X 1920 690.5±1 X 0.05 mm 221 pixel
Panicum miliacecm 2560 X 1920 413±1 X 0.1 mm 269 pixel
Rice 2560 X 1920 413±2 X 0.1 mm 267 pixel
Rice 2560 X 1920 413±1 X 0.05 mm 227 pixel
Wheat 2560 X 1920 692±1 X 0.05 mm 224 pixel
Wheat 2560 X 1920 412.5±1 X 0.1 mm 267 pixel

For training

Please refer to this repository for model weights and training parameters: https://github.com/William-Yao0993/FD_detection


Citation

If you use this project in your research or would like to reference the baseline results, please cite one of the following works:

  • Lingtian Yao, Susanne von Caemmerer, Florence R Danila, SCAN: an automated phenotyping tool for real-time capture of leaf stomatal traits in canola, Journal of Experimental Botany, 2025;, eraf282, https://doi.org/10.1093/jxb/eraf282
@article{10.1093/jxb/eraf282,
    author = {Yao, Lingtian and von Caemmerer, Susanne and Danila, Florence R},
    title = {SCAN: an automated phenotyping tool for real-time capture of leaf stomatal traits in canola},
    journal = {Journal of Experimental Botany},
    pages = {eraf282},
    year = {2025},
    month = {06},
    abstract = {Canola is an important economic and agronomic crop globally, but its yield is under threat due to climate change. Stomata are key breeding target because of their importance in carbon capture and water use efficiency. However, screening for elite stomatal traits could be laborious and time-consuming. We developed a new toolkit called Stomatal Comprehensive Automated Neural Network or SCAN that combines the use of high-resolution portable digital microscopy with machine learning to automate stomatal trait phenotyping in canola. We show that SCAN can rapidly measure stomatal density, size and pore area in canola at 97\% to 99\% accuracy, and capture real-time stomatal pore status that strongly correlated with leaf porometer measurement in canola. Here we use SCAN to investigate how leaf stomatal traits vary through a canopy in different ecotypes of canola grown in the field and glasshouse conditions. SCAN revealed that stomatal density in canola decreases in more expanded leaves with abaxial surface having up to 40\% more stomata that are 2x more open than the adaxial surface. SCAN also showed that patterns of stomatal traits in canola vary between leaf position in the canopy and change with environment in an ecotype-dependent manner.},
    issn = {0022-0957},
    doi = {10.1093/jxb/eraf282},
    url = {https://doi.org/10.1093/jxb/eraf282},
    eprint = {https://academic.oup.com/jxb/advance-article-pdf/doi/10.1093/jxb/eraf282/63585749/eraf282.pdf},
}

About

SCAN is an automated tool for measuring stomatal density and aperture size specific for Canola.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors