Hi, I'm Anne Carpenter from the Broad Institute of Harvard and MIT,
and co-leader of the CellProfiler project.
So, let's say you've identified cells or other regions of interest
within an image,
and maybe you've even tracked them over time in a time-lapse video.
Now, it's time to quantify the biological phenomena
that you're trying to measure.
Now, some measurements that you make from images
are very straightforward.
You can look at, for example,
the counts, how many of a thing is within the image.
You can look at shape and size.
You might be surprised to find that
there's quite a number of metrics for both of these categories.
The shape ones in particular are capturing many different aspects of shapes,
such as the extent of indentations into the structure,
how wiggly the edges are,
and so on.
Now, intensity is one of the most common metrics of interest
in bioimage analysis.
You might have a fluorescent tag for a protein
or some other cell component of interest,
where the intensity of the signal directly corresponds
to the amount of the thing that you're trying to measure.
You might want to measure the precise amount of fluorescence
within each individual cell or other region of interest.
Or you might want to categorize each
as either positive or negative for a particular biomarker.
Either way, you measure the intensity.
So, there's several ways to measure the intensity within a given region.
And here, again, we're looking at an intensity histogram.
Let's say this one is displaying the intensity values
just within a single cell, this large one shown here.
You can see within the region of just this cell,
just within the outlines,
we have a variety of pixel intensities,
ranging from very dark all the way up to very light.
And we don't have a big peak of background pixels,
because we're only looking within this outline.
Now, you can measure the maximum or the minimum intensity values
within this particular cell.
But usually researchers want to measure things
like mean or integrated intensity.
The mean intensity is just how it sounds.
It's the average of all these pixel values.
The integrated intensity
is the sum of pixel values,
and therefore the range of numbers that you get for this
can be in the millions.
Now, to think a little more carefully about mean versus integrated,
it might help to understand that if you cut this particular cell roughly in half,
the mean intensity of each half will be roughly the same,
but the integrated intensity will be cut in half.
One common reason to use integrated intensity
is to measure the overall protein content,
or the overall DNA content,
within each in particular region.
You might be familiar with a cell cycle histogram,
as shown here,
where some cells have twice the amount of DNA content as others
because they've undergone DNA replication.
Now, you really need to think carefully
about what you care about biologically
when you're measuring intensity
to know whether mean or integrated reflects what you actually want to study.
Or, you might decide empirically
based on measuring positive controls.
Now, some cautions when you're measuring intensity in images.
First, you should check out some tips in our overview video
about image acquisition.
It's always better to improve quantification
at the image acquisition stage,
rather than trying to correct for it later.
But still, you should always check for things
like bleaching effects over time,
illumination variations across the field of view,
and so on, and correct for them where it's possible.
You'll also want to include proper controls, of course.
And finally, a segmentation tip.
Although there are exceptions,
you generally don't want to measure the intensity of a stain
within a region that's been defined by that stain.
This can diminish true differences between samples.
And it's a sort of selection bias,
where you're only measuring the intensities
in regions that have a certain minimum brightness.
So, that's something that generally would need to be avoided.
You can measure intensities in any regions you've identified.
So, it can be within the nucleus,
within the cytoplasm.
Or you can also define subareas of a region,
such as concentric rings, as shown here,
around each nucleus.
This is often called radial distribution.
There's also colocalization.
That's a major biological phenotype of interest,
and there's a number of ways to measure it.
Take a look at the CellProfiler website,
because our examples page has a whole tutorial on how...
on the different types and metrics for colocalization,
and the different ways that you want to be able to measure it.
Now, texture metrics capture smoothness of intensity in a sample.
There are many different metrics for capturing it.
There are many different ways to measure smoothness.
And sometimes you even have to choose the scale that you're measuring.
And one way to think about this is
if you're looking at a fabric, if you're looking from far away,
it might appear to be very smooth,
but if you zoom in, you see a lot more texture.
And it's the same when you're measuring fluorescent stains.
At a large scale, there might be a low level of texture,
but at a high scale -- zooming in very, very specifically --
you might start to see a lot more speckling, or a lot more texture.
This can be a useful measure in its... in its own right,
to understand the patterning of a particular stain,
but it's especially useful for quality control.
If you have an automated imaging experiment
that's too large to look at every image individually,
you might want to set up a pipeline where you measure the blurriness of images
by measuring one of these texture metrics.
And finally, spatial relationships
can reveal some really interesting biology.
You can look at things like how many neighbors each cell has
within a tissue.
You can look at the properties of cells nearby other tissue structures,
such as vasculature.
And you can look at the distribution of synapses along neurons, for example.
Now, once you've made whatever measurements of interest you can,
you're ready to explore and statistically analyze your data.
You can use spreadsheet software, the package R,
Jupyter Notebook, KNIME, CellProfiler Analyst,
and many other options.
And these days, it can be particularly interesting
to integrate your image data with other data types,
such as genome, transcriptome, proteome, and more.
Now, most likely in a bioimage analysis workflow,
you want to measure a particular feature of samples.
But you should be aware of this new field of image-based profiling,
where the strategy is to measure as many metrics as is practical
and let the data decide which ones are important
for your given application.
And if you're really daring, you can see if your treatment condition
-- for example, a drug or a genetic knockout --
does something interesting to your biological system
by taking images before and after the treatment,
measuring all the possible features that you can,
and then mining the data,
and seeing if any significant differences arise across all the metrics.
Just be careful to correct for multiple hypothesis testing.
You can also cluster single-cell data
using morphological metrics to explore your system,
for example to identify cell types or unusual phenotypes.
Measuring a lot of cell features
can be especially useful for phenotype classification.
Based on a single cell feature,
such as the size of the nucleus
or the intensity of a stain,
you can categorize or classify cells or other regions
-- colonies, as shown here --
into bins, such as small versus large
or expressing versus non-expressing.
But sometimes a single measured feature
isn't sufficient to identify your cells of interest.
Your eyes pick up on many features at once.
And so, in those cases,
you might need to use machine learning,
where it also examines many features at once.
The strategy needs lots of examples to learn how to make
the same decision that you would make as you look at each cell
or other region of interest.
So, let's walk through this.
You'll remember this first step from the segmentation section
of this video series.
In that section, we taught the computer,
using machine learning,
to decide which pixels belonged to which types of regions of cells,
for example membrane, nucleus, mitochondria.
Here, I'm gonna walk you through a machine learning workflow
where you decide which cells have a phenotype,
and you'll see how it works.
The first step we've already covered in this series.
You want to identify regions of interest
and then measure as many features as you can.
I'm showing this as... sort of schematically,
as a barcode,
but this represents all the numerical measurements
that we've made from each individual cell in this experiment.
Now, in the next step, you're gonna train the classifier.
The classifier is a set of rules
that the computer learns to distinguish the cells
that have a given phenotype
from those without the phenotype.
The computer learns by examples.
So, the biologist looks at random cells from their experiment
and scores them as having the phenotype or not.
And in the meantime, the computer is examining
the measurements of those two classes
and trying to learn how to distinguish them.
As the biologist provides more examples, and corrects errors,
the classifier gets better and better,
in other words more accurate.
And if it's simple,
the biologist might need to sort maybe 100 examples.
If it's a more complex phenotype,
it might be 1000 examples.
Either way, it's less than a day's work or so
to create what is called this training set
of correct answers for the computer to learn on.
Once the accuracy of the classifier is sufficient,
all the cells in the experiment can be classified automatically,
and very quickly,
by running them past the classifier to obtain a score.
There are two user-friendly tools out there
that let you use this process, shown here,
but I will say we've been working on research...
with researchers around the world who created these tools,
and we're working together to make a new web-based tool
for classifying images
that is powered by deep learning.
So, take a look on the website to see if that is ready for use.
Now, some cautions about machine learning.
It's a very powerful tool,
but it can be dangerous,
and even experts make mistakes here sometimes.
Take, for example, training a classifier
to distinguish cats from dogs.
We would train our classifier using example images of both,
and then we test it on an image
that we did not use for training,
and it gives us an answer, that this is a dog.
But it's not a dog, so what's happening here?
Well, we hoped that our classifier
was looking at the patterns of eyes, and ears,
and overall body shape.
But in this example, it learned to distinguish
pictures that have grass from pictures with no grass.
That's one kind of overfitting,
where my training set is very narrow
compared to the kinds of images
where I want to use the trained classifier.
This kind of mistake has happened in most fields,
including microscopy.
Lior Shamir carried out an analysis of public image analysis sets
that had been used to train a classifier
to detect different cell phenotypes.
But he found, very cleverly,
that you could delete the cell pixels in the image
and still get an effective classifier.
You could even just use random patches of background from the images.
In this case, the cells being used to test the accuracy of the classifier
were from the same field of view,
and thus the same lighting and standing condition batch,
as the training images.
So, hopefully those examples will make these tips more clear.
First, when you're creating the annotations for your training set,
these should be done on images that include a lot of variation,
and it should be a sufficiently large set.
So, for example, you want to use multiple independent batches for training,
not just one image or one particular batch
of experimental microscopy images.
You want to use multiple positive controls for a particular phenotype.
You want to use multiple lab setups, if your goal is to make the classifier
that will work across many different labs and so on.
Secondly, you want to test accuracy
on completely held-out samples.
For example, you want to test on a different batch
than you used for the training.
And number three, aside from seeking expert help
designing your machine learning strategy,
as in the first two tips,
as a reality check for number three,
you want to check what features are being used by the trained classifier.
So, for example, what channels, what features
is it reading out for your phenotype of interest?
And do they make biological sense?
So, I hope you enjoyed learning more about the kinds of measurements
that you can make for images.
And I hope you'll check out the best practices part of our video series.