Quantitative Big Imaging

Statistics and Reproducibility

ETHZ: 227-0966-00L

## Loading required package: knitr

Course Outline

Literature / Useful References


Papers / Sites

Model Evaluation

Previously on QBI …

Quantitative “Big” Imaging

The course has covered imaging enough and there have been a few quantitative metrics, but “big” has not really entered.

What does big mean?

So what is “big” imaging

doing analyses in a disciplined manner

having everything automated

being able to adapt and reuse analyses


  1. Scientific Studies all try to get to a single number
  1. How do we compare the number from different samples and groups?
  1. How do we compare different processing steps like filter choice, minimum volume, resolution, etc?
  2. How do we evaluate our parameter selection?
  3. How can we ensure our techniques do what they are supposed to do?
  4. How can we visualize so much data? Are there rules?


What do we start with?

Going back to our original cell image

  1. We have been able to get rid of the noise in the image and find all the cells (lecture 2-4)
  2. We have analyzed the shape of the cells using the shape tensor (lecture 5)
  3. We even separated cells joined together using Watershed (lecture 6)
  4. We have created even more metrics characterizing the distribution (lecture 7)

We have at least a few samples (or different regions), large number of metrics and an almost as large number of parameters to tune

How do we do something meaningful with it?

Correlation and Causation

One of the most repeated criticisms of scientific work is that correlation and causation are confused.

  1. Correlation
  1. Causation

Controlled and Observational

There are two broad classes of data and scientific studies.


We examined 100 people and the ones with blue eyes were on average 10cm taller

In 100 cake samples, we found a 0.9 correlation between cooking time and bubble size


We examined 50 mice with gene XYZ off and 50 gene XYZ on and as the foot size increased by 10%

We increased the temperature and the number of pores in the metal increased by 10%

Simple Model: Magic / Weighted Coin

incremental: true

Since most of the experiments in science are usually specific, noisy, and often very complicated and are not usually good teaching examples

Simple Model: Magic / Weighted Coin

  1. Each coin represents a stochastic variable \(\mathcal{X}\) and each flip represents an observation \(\mathcal{X}_i\).
  2. The act of performing a coin flip \(\mathcal{F}\) is an observation \(\mathcal{X}_i = \mathcal{F}(\mathcal{X})\)

We normally assume

  1. A fair coin has an expected value of \(E(\mathcal{X})=0.5 \rightarrow\) 50% Heads, 50% Tails
  2. An unbiased flip(er) means

Simple Model to Reality

Coin Flip

  1. Each flip gives us a small piece of information about the flipper and the coin
  2. More flips provides more information

Real Experiment

  1. Each measurement tells us about our sample, out instrument, and our analysis
  2. More measurements provide more information


A very broad topic with plenty of sub-areas and deeper meanings. We mean two things by reproducibility


The process of going from images to numbers is detailed in a clear manner that anyone, anywhere could follow and get the exact (within some tolerance) same numbers from your samples - No platform dependence - No proprietary or “in house” algorithms - No manual clicking, tweaking, or copying - One script to go from image to result


Everything for analysis + taking a measurement several times (noise and exact alignment vary each time) does not change the statistics significantly - No sensitivity to mounting or rotation - No sensitivity to noise - No dependence on exact illumination

Reproducible Analysis

The basis for reproducible scripts and analysis are scripts and macros. Since we will need to perform the same analysis many times to understand how reproducible it is.

matlab -r "inImage=$IMAGEFILE; threshImage=inImage>$THRESHOLD; analysisScript;"

Comparing Groups: Intraclass Correlation Coefficient

The intraclass correlation coefficient basically looking at how similar objects within a group are compared to between groups

Intraclass Correlation Coefficient Definition

\[ ICC = \frac{S_A^2}{S_A^2+S_W^2} \]

where - \(S_A^2\) is the variance among groups or classes - Estimate with the standard deviations of the mean values for each group - \(S_W^2\) is the variance within groups or classes. - Estimate with the average of standard deviations for each group

Intraclass Correlation Coefficient: Values

Intraclass Correlation Coefficient: Values for Coin-Flips

We have one biased coin and try to figure out how many flips we need for the ICC to tell the difference to the normal coin

With many thousands of flips we eventually see a very strong difference but unless it is very strongly biased ICC is a poor indicator for the differences

Comparing Groups: Tests

Once the reproducibility has been measured, it is possible to compare groups. The idea is to make a test to assess the likelihood that two groups are the same given the data

  1. List assumptions
  2. Establish a null hypothesis
  1. Calculate the probability of the observations given the truth of the null hypothesis

Loaded Coin

We have 1 coin from a magic shop - our assumptions are - we flip and observe flips of coins accurately and independently - the coin is invariant and always has the same expected value - our null hypothesis is the coin is unbiased \(E(\mathcal{X})=0.5\) - we can calculate the likelihood of a given observation given the number of flips (p-value)

Number of Flips Probability of All Heads Given Null Hypothesis (p-value)
1 50 %
5 3.1 %
10 0.1 %

How good is good enough?

Comparing Groups: Student’s T Distribution

Since we do not usually know our distribution very well or have enough samples to create a sufficient probability model

Student T Distribution

We assume the distribution of our stochastic variable is normal (Gaussian) and the t-distribution provides an estimate for the mean of the underlying distribution based on few observations.

Student T-Test

Incorporates this distribution and provides an easy method for assessing the likelihood that the two given set of observations are coming from the same underlying process (null hypothesis)

Multiple Testing Bias

Back to the magic coin, let’s assume we are trying to publish a paper, we heard a p-value of < 0.05 (5%) was good enough. That means if we get 5 heads we are good!

Number of Flips Probability of All Heads Given Null Hypothesis (p-value)
1 50 %
4 6.2 %
5 3.1 %
Number of Friends Flipping Probability Someone Flips 5 heads
1 3.1 %
10 27.2 %
20 47 %
40 71.9 %
80 92.1 %

Clearly this is not the case, otherwise we could keep flipping coins or ask all of our friends to flip until we got 5 heads and publish

The p-value is only meaningful when the experiment matches what we did. - We didn’t say the chance of getting 5 heads ever was < 5% - We said if we have exactly 5 observations and all of them are heads the likelihood that a fair coin produced that result is <5%

Many methods to correct, most just involve scaling \(p\). The likelihood of a sequence of 5 heads in a row if you perform 10 flips is 5x higher.

Multiple Testing Bias: Experiments

This is very bad news for us. We have the ability to quantify all sorts of interesting metrics - cell distance to other cells - cell oblateness - cell distribution oblateness

So lets throw them all into a magical statistics algorithm and push the publish button

With our p value of less than 0.05 and a study with 10 samples in each group, how does increasing the number of variables affect our result