Skip to content

Machine Learning Workflow

Jeffrey Berry edited this page Sep 19, 2019 · 6 revisions

Machine Learning Workflow

  1. Make training image as a collage of several test images
  2. Use the pencil tool in ImageJ and draw over all features of interest
  3. Convert to Lab, split channels, and find L
  4. Threshold the image to get the feature mask and save it
  5. Train naive Bayes or SVM using ML_CREATE specifying classifier type
PhenotyperCV -m=ML_CREATE -method=bayes -i=input_image.png -b=labeled_image.png -class=output_bayes_classifier.yaml
  1. Check the classifier prediction using either ML_PRED specifying classifier type
PhenotyperCV -m=ML_PRED -method=bayes -i=input_image.png -class=input_bayes_classifier.yaml
  1. If prediction is satisfactory, process images using ML_PROC specifying classifier type
PhenotyperCV -m=ML_PROC -method=bayes -i=test_combine.png -class=input_bayes_classifier.yaml -size=8 -s=shapes.txt -c=gray.txt

The processing step consists of four phases:

  1. Click only the gray scale color chips from black to white
  2. Feature prediction of input image
  3. Threshold the prediction to isolate features
  4. Click on the features to measure. If there are different types of features that you'd like to consider separate, currently only three different features are supported and you can specify them by which type of mouse click you use. Left = red, right = green, middle = blue.

Output files

Shapes

wt/092718_Day9_wt_2b.jpg green 1 105 182 240.5 0.756757 94.9117 21 19 822.577 287.484 11 822.081 287.637 21.4268 12.1743 49.7118 0.929319 0.253888 0.568183 1.76 1.29689 0

Each line in the file has meta data: image name, contour color, contour number, threshold used, area, hull_area, solidity, perimeter, width, height, center of mass x, center of mass y, hull verticies, ellipse center x, ellipse center y, ellipse major axis, ellipse minor axis, ellipse angle, ellipse eccentricity, circularity, roundness, aspect ratio, fractal dimension, out of frame.

Lightness

wt/092718_Day9_wt_2b.jpg green 1 105 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 1 0 0 0 3 0 2 6 3 3 5 3 4 5 4 7 9 7 6 7 10 11 8 7 13 7 2 6 9 3 10 4 6 8 7 6 3 4 10 7 6 14 17 14 12 26 15 16 11 21 13 8 9 4 3 7 3 2 2 4 3 0 2 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 2 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 2 0 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Each line in the file has meta data: image name, contour color, contour number, threshold used, Lightness channel histogram from 0-255