Skip to content

How to Use

rickyota edited this page May 23, 2021 · 6 revisions

Contents

Images

You have to prepare 3 kinds of images, training images, labeled images and inference images. Training Images and Labeled images are used to optimize classifier. Segmented Images of inference images are returned.
Format of Images can be a folder containing images, one tiff file or one other image file. Just Drag & Drop them when you use application. When you use codes, just put them into CSML/data/ and specify in csml.sh bash file. Format of returned images is png files for folder input or tiff file for tiff input.

Training Images

Training images should be fluorescent images of embryos and corresponding to labeled images.
The images can be color images or grayscale images. Refer example to CSML/data/folder_train/example_train.png.

Labeled Images

Labeled images should be contoured binary images of training images. Only completely surrounded regions are used.
The images should be binary images. Refer example to CSML/data/folder_label/example_train.png.

Inference Images

Inference images should be fluorescent images of embryos like training images. Inference Images whose segmented images you want are set. The images can be color images or grayscale images. Refer example to CSML/data/folder_label/example_infer.png.

CSML Application

Installation

Download from Releases.

Usage

  1. Launch CSML.exe.
  2. Train model (only for the first time).
    1. Drag & Drop the images file and the corresponding binary images file.
    2. Specify name of model.
    3. Adjust the parameters if you want.
    4. Press "Start Training" button.
  3. Infer images.
    1. Drag & Drop the images file which you want to segment.
    2. Select the model which you want to use.
    3. Adjust the parameters if you want.
    4. Select output folder.
    5. Press "Start Infering" button.
  4. Get segmented images file in output folder.

Notes

  • Click "Run with Example" to use examples.
  • Format of Images can be a folder containing images, one tiff file or one other image file.
  • Accuracy displayed in model list is dot accuracy.

CSML Codes

Please refer to this section if you want to run the codes directly.

Requirement

  • conda

Installation

git clone https://github.com/rickyota/CSML.git

You need to use conda to install python dependencies.

conda env create --file environment.yml

Usage

Training Classifier and Inferring Images

If you have no trained classifiers, you have to train classifier first.

  1. Add training, labeled and inference images to ./data/.
    The format can be a folder containing images, one tiff file or one other image file.
    Make sure that you indicate the same image name in label and train folder.

  2. Use csml.sh or edit values in csml_paras.sh.

  3. Execute

    $ bash csml.sh
    
  4. Inferred images are saved in ./result/.

Only Inferring Images

If you have trained classifier, you can only infer images.

  1. Add training, inference images to ./data/.
    The format can be a folder containing images, one tiff file or one other image file.

  2. Use csml_onlyinfer.sh

    $ bash csml_onlyinfer.sh
    
  3. Inferred images are saved in ./result/.