Configuring your model

Once you have a model that works well, you might want to add and remove different metrics for morphological characteristics, intensity, model score, or others.

You can change the metrics computed per object, predict fewer or greater objects, or create parent-child hierarchies to answer questions like "How many of class X in class Y?". Find each section below.

Customizing model behavior

To customize model behavior, it must be activated. For all customizations on this page, your metrics will only be computed for new results. Submit a new run to see your changes.

To customize model behavior, head over to AI Projects and click on your project. In the bottom section under Active AI models, choose the version you'd like to customize. Then follow the instructions for what you want to customize.

Predict greater or fewer # of objects

For object classes, every prediction comes with a model score, which is a decimal ranging from 0 to 1. To reduce the number of bad predictions, we set a threshold at 0.05, which filters out predictions with a model score less than 0.05.

To change the threshold used for cutoff during analysis time, go to the Train/test predictions tab. Simply drag the slider, and observe the changes that you see. Then, to lock in that threshold for analysis, select Update analysis threshold.

Change computed metrics

Each model comes with default metrics for each object, such as X-Y position, object area, channel intensities, and more. You can add or remove metrics by going to the Metrics tab. Check on or off metrics, and hit Save selection to lock in your settings.

  • X Position - Pixel X position of the centroid of the object (left to right). This is in absolute pixels of the entire image.

  • Y Position - Pixel Y position of the centroid of the object (top to bottom). This is in absolute pixels of the entire image.

  • Area - Number of pixels that the object covers.

  • Perimeter - Count of pixels over the outer boundary of the object.

  • Image origin - Filename of the image the object originated from.

  • Average Intensity (channel N) - Average intensity in channel N over the object area. If there are N channels in the image, there will be N channel features.

  • Solidity - A measurement of the overall concavity of an object. Ratio of pixels in the region to pixels of the convex hull image.

  • Eccentricity - A measure of how elliptical an object is. A perfect circle has an eccentricity of 0.

  • Major axis - The length of the major axis of the ellipse that has the same normalized second central moments as the region. This is generally a good proxy for the longest width of the object.

  • Minor axis - The length of the minor axis of the ellipse that has the same normalized second central moments as the region. This is generally a good proxy for the shortest width of the object.

  • Curved length - A good metric for the length of a long curved object (like lung cells, worms, etc). Obtained using the binary skeletonization of the mask, this is not a good fit for mostly circular objects.

  • Model score - The score, generally from 0 to 1, that the AI model computed for this object. This is often referred to as the confidence score.

Less common

  • Equivalent Diameter - The diameter of a circle with the same area as the object.

  • Euler Number - The total number of objects minus the total number of holes in those objects in an image.

  • Extent - The ratio of pixels in the object to the pixels in the bounding box of the object.

  • Feret Diameter Maximum - The longest distance between points around an object’s convex hull contour.

  • Orientation - The orientation of the object.

  • Perimeter Crofton - The perimeter of the object approximated by the Crofton formula in 4 directions.

  • Area Bounding Box - The number of pixels the bounding box of the object occupies.

  • Area Convex - The area of the convex hull image, which is the smallest convex polygon that encloses the region.

  • Area Filled - The area of the region with all holes filled in.

  • Colocalization: Pearson - Correlation coefficient between channel pairs

  • Colocalization: Manders - Overlap coefficient between channel pairs


Hierarchies are parent-child relationships that allow metrics such as Number of Class X within Class Y, as well as others. Examples of how you might use this as parent→child:

  • Organoid→cell Get the number of cells per organoid

  • Cell→puncta Get the number of puncta within each cell

  • Tissue region→positive cell Count number of positive cells in a certain region

  • Tumor→immune cell Get metrics for immune cell infiltration

To create a new hierarchy, start from Configure class hierarchy. From there, select Create class hierarchy. Fill out the form and press OK.

Configure grow/shrink transforms

Grow or shrink a class of objects. Growing can be helpful for growing cells out from the nucleus, or associating cytoplasmic or extracellular expression or puncta with the closest cell. Shrinking can be useful for excluding autofluorescence or edge effects from the edge of a cell or tissue sample.

Last updated